NullInjectorError: No provider for Http!
See original GitHub issueUpgraded some libraries and now i get this error:
StaticInjectorError[Http]:
StaticInjectorError[Http]:
NullInjectorError: No provider for Http!
here’s my app.module.js
, you’ll see that NativeScriptHttpModule
is imported as expected:
import {NgModule, NO_ERRORS_SCHEMA} from "@angular/core";
import {NativeScriptModule} from "nativescript-angular/nativescript.module";
import {NativeScriptFormsModule} from "nativescript-angular/forms";
import {NativeScriptHttpModule} from "nativescript-angular/http";
import {
DeviceService,
DirectionsService,
ParamsService,
ShuttleRideService,
ShuttleService,
StationService
} from "@suna/quickride-ts-libcore";
import {
ActionBarLarge,
AppRoutingModule,
ConnectionInfo,
ConnectivityService,
EnRoutePage,
LocationService,
LoginPage,
NotificationHandler,
RideListItem,
RideListPage,
RouterData,
ShuttleListItem,
ShuttleListPage,
TaskPage
} from "./quickride";
import {AppComponent} from "./app.component";
@NgModule({
bootstrap: [AppComponent],
imports: [
NativeScriptModule,
NativeScriptFormsModule,
NativeScriptHttpModule,
AppRoutingModule
],
declarations: [
ActionBarLarge,
RideListItem,
ShuttleListItem,
NotificationHandler,
ConnectionInfo,
AppComponent,
LoginPage,
ShuttleListPage,
RideListPage,
EnRoutePage,
TaskPage
],
providers: [
RouterData,
DirectionsService,
ShuttleService,
ShuttleRideService,
StationService,
DeviceService,
LocationService,
ConnectivityService,
ParamsService
],
schemas: [
NO_ERRORS_SCHEMA
]
})
export class AppModule {
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Angular EXCEPTION: No provider for Http - Stack Overflow
Ideally, you split up this code in two separate files. For further information read: ... and include the http class in providers section,...
Read more >Angular EXCEPTION: No Provider For Http! Error Fix
To avoid Angular EXCEPTION: No provider for Http! error we need to import HttpClientModule from @angular/common/http.
Read more >Fixing NullInjectorError: No provider for HttpClient - Upmostly
This is such a simple error but one that catches me out on every single new project it seems. The full error is...
Read more >Ionic v4 : NullInjectorError: No provider for HTTP!
i am new to ionic and i want to use a service for retrieving data from the REST API but i get this...
Read more >No provider for HttpClient | Edureka Community
I also updated all HttpModule and Http to HttpClientModule. ... StaticInjectorError[HttpClient]: NullInjectorError: No provider for ...
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
Hi @briandilley, Could you try replacing the old
nativescript-angular/http
module with thenativescript-angular/http-client
? The http-client is introduced with the latest versions of Angular and it is upgraded version of http. More about it could be found here in the Angular docs.Also, you could review our example here where it is used the http-client module.
In case the problem still persists, please provide sample project, which could be debugged locally.
Hi @WrightTrae, You can find the example here