-
-
Notifications
You must be signed in to change notification settings - Fork 241
NS_HTTP_PROVIDERS angular rc4 with [email protected] still problem #393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks @leocaseiro I can confirm this report. @vakrilov If you instead use |
Hi @NathanWalker, thanks for your reply. There're 2 versions of 0.3.1: However, they both give me the same error. Unfortunately, I'm getting the same issue. |
Here is my package.json:
I've updated to the newest |
Try clearing node_modules and platforms then setup again with that 'next' tag. |
I did exactly that here and have no issues using the 'next' tag and rc.4 |
I was about to post it here. I removed the platform and added it again and works fine. Many thanks for that! I wonder if it'll be safe to use the |
I would personally like to see weekly releases of 'nativescript-angular' but until that happens I will be using 'next' tag with everything myself. Too many important and valuable things go into master at every commit from what I've seen to not be using latest. |
I hit this one in Groceries, and unfortunately I can’t seem to make the problem go away. I tried using Regardless, I can’t update the Getting Started tutorial to use |
I was able to reproduce @leocaseiro's original issue (the compile time error) using the official 0.3.0 release on a new project after importing NSHttp. I also saw another error about I deleted my I wonder if adding an import for @tjvantoll I don't get that error with the Groceries master branch. Do I need to look somewhere else? |
Hi @hdeshev, thanks for that! I'm almost sure you want to test on angular-end branch of Groceries. In regards to |
Yep, I believe that's the problem that the "import 'rxjs/add/operator/...'" is trying to solve. It's probably a good idea to let people import either rxjs/Rx or the single operator module, if they are going after a lean distribution. |
@hdeshev: @leocaseiro is correct; it’s the angular-end branch that I’m having this problem on, which is the end state of the getting started tutorial. I can try the RxJS workarounds, but I’m always hesitant to put any workarounds or hacks into the tutorials, so I’ll almost certainly just wait for a 0.3.1 release. |
Bizarrely I’m still getting the same TypeScript error even after upgrading to 0.3.1, which makes me suspect that I’m hitting some sort of odd caching problem. I tried clearing my npm cache, and also rebuilding my |
@tjvantoll You may need to upgrade to rc.4 on the angular branch of groceries: |
@NathanWalker Yep. I did that as part of the update. Here are the full steps I’m taking:
|
@tjvantoll @vakrilov Please release @tjvantoll, also note this:
And this:
See this to learn more: |
Worth noting again using the |
@leocaseiro please reopen this issue and rename to: |
@NathanWalker Thanks for taking the time to confirm this! |
OK,
Notice the problematic type is However, |
Thanks @vakrilov for investigation. Yeah, this one seems confusing. |
@NathanWalker @vakrilov i am having different problem with the next tag and next version. when i use next tag or use tns plugin add nativescript-angular@next to upgrade my "nativescript-angular" and after i change my main.ts with my app wont open and i get this following error TypeError: global.moduleMerge is not a function StackTrace: |
Update: WorkaroundFirst of all the workaround that worked for me was to add
Clean The ProblemI think the problem is that the
The typescript compiler uses different If you have dependency to The SolutionProbably using peerDependency to We need to test that to be sure it works. I the meantime - you can test if the workaround above works. |
@vakrilov i tried using your workaround delete node modules and platforms add the necessary dependencies to package and added the NS_HTTP_PROVIDERS to my main.ts but after prepare and build the project i still get the following error as soon as may app opens ava.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: TypeError: global.moduleMerge is not a function StackTrace: if i dont add the NS_HTTP_PROVIDERS to my main.ts and use HTTP_PROVIDERS instead my app opens but get the following error when i try to use http request com.tns.NativeScriptException: EXCEPTION: Error in pages/login/login.html:6:49 |
@tomylee001001 That looks like another issue (NativeScript/NativeScript#143). Can you make sure that |
@vakrilov, @tomylee001001 That solved the problem for me - nativescript-angular/application was not the first import. But after when placing it first the problem with global.moduleMerge... went away! Thanks! |
@vakrilov: Explicitly adding rxjs to my dependencies indeed worked. Thanks so much! |
@vakrilov Any concerns with merging this in? https://github.com/NativeScript/template-hello-world-ng/pull/22 |
@vakrilov placing the import {nativeScriptBootstrap} from "nativescript-angular/application"; first in my main.ts solve this error for me. |
Closing since the problem should be resolved with 2.0.0 final and the |
Uh oh!
There was an error while loading. Please reload this page.
If you just import
NS_HTTP_PROVIDERS
and set on your bootstrap, you won't pass through the Typescript compiler and will get this error:To check this bug, follow these steps:
Then, import NS_HTTP_PROVIDERS:
So try add a platform and run:
Temporary solution
I believe something related to the declaration on
node_modules/nativescript-angular/http/ns-http.d.ts
that doesn't follow with the angular rc-4.The text was updated successfully, but these errors were encountered: