Runtime Error
Uncaught (in promise): Error: StaticInjectorError[HTTP]: StaticInjectorError[HTTP]: NullInjectorError: No provider for HTTP! Error: StaticInjectorError[HTTP]: StaticInjectorError[HTTP]: NullInjectorError: No provider for HTTP! at NullInjector.get (http://localhost:8100/build/vendor.js:1276:19) at resolveToken (http://localhost:8100/build/vendor.js:1564:24) at tryResolveToken (http://localhost:8100/build/vendor.js:1506:16) at StaticInjector.get (http://localhost:8100/build/vendor.js:1377:20) at resolveToken (http://localhost:8100/build/vendor.js:1564:24) at tryResolveToken (http://localhost:8100/build/vendor.js:1506:16) at StaticInjector.get (http://localhost:8100/build/vendor.js:1377:20) at resolveNgModuleDep (http://localhost:8100/build/vendor.js:10938:25) at NgModuleRef.get (http://localhost:8100/build/vendor.js:12159:16) at resolveDep (http://localhost:8100/build/vendor.js:12655:45)
Stack
Error: Uncaught (in promise): Error: StaticInjectorError[HTTP]:
StaticInjectorError[HTTP]:
NullInjectorError: No provider for HTTP!
Error: StaticInjectorError[HTTP]:
StaticInjectorError[HTTP]:
NullInjectorError: No provider for HTTP!
at NullInjector.get (http://localhost:8100/build/vendor.js:1276:19)
at resolveToken (http://localhost:8100/build/vendor.js:1564:24)
at tryResolveToken (http://localhost:8100/build/vendor.js:1506:16)
at StaticInjector.get (http://localhost:8100/build/vendor.js:1377:20)
at resolveToken (http://localhost:8100/build/vendor.js:1564:24)
at tryResolveToken (http://localhost:8100/build/vendor.js:1506:16)
at StaticInjector.get (http://localhost:8100/build/vendor.js:1377:20)
at resolveNgModuleDep (http://localhost:8100/build/vendor.js:10938:25)
at NgModuleRef.get (http://localhost:8100/build/vendor.js:12159:16)
at resolveDep (http://localhost:8100/build/vendor.js:12655:45)
at c (http://localhost:8100/build/polyfills.js:3:19752)
at Object.reject (http://localhost:8100/build/polyfills.js:3:19174)
at NavControllerBase._fireError (http://localhost:8100/build/vendor.js:48484:16)
at NavControllerBase._failed (http://localhost:8100/build/vendor.js:48477:14)
at http://localhost:8100/build/vendor.js:48524:59
at t.invoke (http://localhost:8100/build/polyfills.js:3:14976)
at Object.onInvoke (http://localhost:8100/build/vendor.js:4982:33)
at t.invoke (http://localhost:8100/build/polyfills.js:3:14916)
at r.run (http://localhost:8100/build/polyfills.js:3:10143)
at http://localhost:8100/build/polyfills.js:3:20242
add this in app.module
import { HTTP } from '@ionic-native/http';
imports: [
BrowserModule,
IonicModule.forRoot(MyApp),
HTTP
],
Thanks!
But I done it and it didnât work,
They told me to to used HTTPModule also, itâs the same
Hi, I faced this issue and fix it with importing both of:
import { Http } from '@angular/httpâ
import { HttpClientModule } from â@angular/common/httpâ;
Donât forget to add HttpClientModule to the app.module providers also
Hey guys, i have seen the above suggestions but i keep on getting this error:
âUnexpected value âHTTPâ imported by module âAppModuleâ . Please add a @NgModule annotationâ.
How can i solve this, kindly assist.
In app.module.ts
- Add import { HTTP } from â@ionic-native/httpâ;
- Add HTTP into providers: [ ⌠HTTP âŚ];
It worked for me (:
Another right way:
import { HttpModule } from â@angular/httpâ; on app.module.ts
import { Http } from â@angular/httpâ; on the page youâll work on it with the constructor injection (public http: Http,) ⌠so now you can manipulate with commands like this.http.get(âŚ)
@emadhidemo @vgonsalez @Francdev @dery
Hi guys, i have the same problem and tried all the above but non of them works. Please suggest me any other way i am facing this issue for the last two weeks but couldnât solve yet.
So the get like that: this.http.get(url).map(res => res.json()).subscribe(data=>{ ⌠})
I Worte it as a steps hereunder,
i should write my file name in firebase instead of res.json??? @emadhidemo
Runtime Error
Uncaught (in promise): ReferenceError: res is not defined ReferenceError: res is not defined at new HomePage (http://localhost:8100/build/main.js:65:29) at createClass (http://localhost:8100/build/vendor.js:12859:20) at createDirectiveInstance (http://localhost:8100/build/vendor.js:12700:37) at createViewNodes (http://localhost:8100/build/vendor.js:14158:53) at createRootView (http://localhost:8100/build/vendor.js:14047:5) at callWithDebugContext (http://localhost:8100/build/vendor.js:15472:42) at Object.debugCreateRootView [as createRootView] (http://localhost:8100/build/vendor.js:14755:12) at ComponentFactory_.create (http://localhost:8100/build/vendor.js:11652:46) at ComponentFactoryBoundToModule.create (http://localhost:8100/build/vendor.js:4404:29) at NavControllerBase._viewInit (http://localhost:8100/build/vendor.js:51720:44)
this is the error i have in
What you need to do exactly Mohamed maybe I can help, the page error code of the http import, firebase is different, the run time error you sent now âresâ!?
@emadhidemo thank you so much. the problem solved
mohammad77 could be a good practice to post how you solve the problem, donât you think so?
I forgot put httpClientModule in the providers part . This i show i solved @rpicilli
Thank you Mohammad77 by your attention in reply.
Worked, thank you very much.
Just a note if somebody fell here: you may not need both @angular/http
and @angular/common/http
, this package was renamed and updated by the Angular team. The newest version is the HttpClient
(common/http
). Youâll also have to import HttpClientModule
(or the old HttpModule
according to what youâre using).