NS_HTTP_PROVIDERS angular rc4 with nativescript-angular@0.3.1 still problem
See original GitHub issueIf you just import NS_HTTP_PROVIDERS
and set on your bootstrap, you won’t pass through the Typescript compiler and will get this error:
Found peer TypeScript 1.8.10
node_modules/nativescript-angular/http/ns-http.d.ts(8,22): error TS2415: Class 'NSHttp' incorrectly extends base class 'Http'.
Types of property 'get' are incompatible.
Type '(url: string, options?: RequestOptionsArgs) => Observable<any>' is not assignable to type '(url: string, options?: RequestOptionsArgs) => Observable<Response>'.
Type 'Observable<any>' is not assignable to type 'Observable<Response>'.
Property 'source' is protected but type 'Observable<T>' is not a class derived from 'Observable<T>'.
To check this bug, follow these steps:
tns create myapp --template tns-template-hello-world-ng
Then, import NS_HTTP_PROVIDERS:
import {NS_HTTP_PROVIDERS} from 'nativescript-angular/http';
nativeScriptBootstrap(AppComponent, [NS_HTTP_PROVIDERS])
So try add a platform and run:
tns platform add ios
tns run ios --emulator
Temporary solution
If you’ve set
compilerOptions
to false ontsconfig.json
, the tsc will ignore it, and your app will run great. (Even if you use Http service).
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.
Issue Analytics
- State:
- Created 7 years ago
- Comments:31 (20 by maintainers)
Top Results From Across the Web
Bootstrapping angular RC4 with SystemJS throws Uncaught ...
The error focuses on the first angle bracket of the html file. As if systemJS tries to run the index.html as the config...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just one note for anyone in the future who might run into this (again). Occasionally npm will also install RXJS into a sub-folder of one of the modules; if you continue to get this error even after you have deleted your node_modules folder. Double check each of the modules to see if they have any sub “node_modules” folders themselves; and if they do; delete any extra the “rxjs” that ends up in as a sub-folder version. The beta5 that got installed by one of them; conflicted with the beta12 that was needed by everything else, and caused the primary error in this issue.
Closing since the problem should be resolved with 2.0.0 final and the
NativeScriptHttpModule
that sets up providers for you.