Skip to content

NullInjectorError: No provider for Http! #1138

@briandilley

Description

@briandilley

Upgraded 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 {

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions