Uncaught (in promise): Error: No provider for ConnectionBackend!


#1

I am trying to solve this issue since last 3 days but not able to find out any solution for this.

Every time when ever I’m importing HTTP in my .ts file it is showing error “”.

Packages.js

“dependencies”: {
"@angular/common": “4.1.0”,
"@angular/compiler": “4.1.0”,
"@angular/compiler-cli": “4.1.0”,
"@angular/core": “4.1.0”,
"@angular/forms": “4.1.0”,
"@angular/http": “4.1.0”,
"@angular/platform-browser": “4.1.0”,
"@angular/platform-browser-dynamic": “4.1.0”,
"@ionic-native/core": “^3.8.0”,
"@ionic-native/geolocation": “^3.8.0”,
"@ionic-native/splash-screen": “3.7.0”,
"@ionic-native/status-bar": “3.7.0”,
"@ionic/storage": “2.0.1”,
“ionic-angular”: “3.2.1”,
“ionicons”: “3.0.0”,
“rxjs”: “5.1.1”,
“sw-toolbox”: “3.6.0”,
“zone.js”: “0.8.10”

See the error screenshots.

Please help me to resolve this issue as this is very much critical for me.


#2

Is there a provider for ConnectionBackend?
What exactly are you trying to do anyway?


#3

Go to your app.module.ts

import { ConnectionBackend } from '../providers/connection-backend'; // The exact route

@NgModule({
  providers: [
    ConnectionBackend,
    {provide: ErrorHandler, useClass: IonicErrorHandler}]
})

#4

I disagree with the previous post, and suspect that OP has Http in their app module’s providers array. Get it out of there.


#5

Issue got resolved after importing HttpModule in module js file.