sneas / ionic-native-http-connection-backend

A solution to CORS issues with Ionic and iOS
MIT License
159 stars 48 forks source link

Error: "No provider for ResponseOptions!" #4

Closed yossi-shasho closed 7 years ago

yossi-shasho commented 7 years ago

After following the instructions, I get this error on the console, when i try to run my ionic 3.2 app: No provider for ResponseOptions! ; Zone: <root> ; Task: Promise.then ; Value: Error: No provider for ResponseOptions!

my imports:

imports: [
    BrowserModule,
    NativeHttpModule,
    IonicModule.forRoot(MyApp, {
      backButtonText: '',
      modalEnter: 'modal-slide-in',
      modalLeave: 'modal-slide-out',
      tabsPlacement: 'bottom',
      scrollAssist: false, 
      autoFocusAssist: false,
      mode: 'ios' // display iphone layouts on android too, e.g. headers and buttons.
    }),
    IonicStorageModule.forRoot(),
    ElasticModule,
    MomentModule, // TODO - moments.js
    Ionic2RatingModule,
    EnvModule
  ]

my providers:

providers: [
    GooglePlus,
    LocalNotifications,
    SimpleGlobal,
    { provide: ErrorHandler, useClass: IonicErrorHandler },
    AppConfig,
    { provide: APP_INITIALIZER, useFactory: (config: AppConfig) => () => config.load(), deps: [AppConfig], multi: true },
    { provide: Http, useClass: Http, deps: [ NativeHttpFallback, RequestOptions ] },
    SplashScreen,
    FacebookLoginService,
    GoogleLoginService,
    HTTP,
    File,
    Transfer,
    StorageService,
    DatePicker,
    AuthService,
    ConfService,
    CameraService,
    Mixpanel,
    AlertService,
    CloudfrontService,
    SocketService,
    Keyboard,
    Animation,
    PhotoViewer,
    PhotoViewerService,
    ImagePicker,
    Geolocation,
    Location,
    NativeGeocoder,
    LocationAccuracy,
    Deeplinks,
    ChatInit,
    Push,
    StatusBar,
    InAppBrowser,
    InitPushNotificationService,
    PaymentReqData,
    PayPalService,
    BadgeInboxService,
    SocialSharing,
    ShareService
  ]

full stack trace:

 No provider for ResponseOptions! ; Zone: <root> ; Task: Promise.then ; Value: Error: No provider for ResponseOptions!
    at injectionError (core.es5.js:1231)
    at noProviderError (core.es5.js:1269)
    at ReflectiveInjector_._throwOrNull (core.es5.js:2770)
    at ReflectiveInjector_._getByKeyDefault (core.es5.js:2809)
    at ReflectiveInjector_._getByKey (core.es5.js:2741)
    at ReflectiveInjector_.get (core.es5.js:2610)
    at AppModuleInjector.createInternal (module.ngfactory.js? [sm]:1)
    at AppModuleInjector.NgModuleInjector.create (core.es5.js:3537)
    at NgModuleFactory.create (core.es5.js:3510)
    at core.es5.js:4748 Error: No provider for ResponseOptions!
    at injectionError (http://localhost:8100/build/main.js:1510:86)
    at noProviderError (http://localhost:8100/build/main.js:1548:12)
    at ReflectiveInjector_._throwOrNull (http://localhost:8100/build/main.js:3049:19)
    at ReflectiveInjector_._getByKeyDefault (http://localhost:8100/build/main.js:3088:25)
    at ReflectiveInjector_._getByKey (http://localhost:8100/build/main.js:3020:25)
    at ReflectiveInjector_.get (http://localhost:8100/build/main.js:2889:21)
    at AppModuleInjector.createInternal (ng:///AppModule/module.ngfactory.js:400:87)
    at AppModuleInjector.NgModuleInjector.create (http://localhost:8100/build/main.js:3816:76)
    at NgModuleFactory.create (http://localhost:8100/build/main.js:3789:18)
    at http://localhost:8100/build/main.js:5027:61

package.json 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",
    "@angular/platform-server": "4.0.0",
    "@angular/tsc-wrapped": "^4.2.5",
    "@ionic-native/camera": "^3.4.4",
    "@ionic-native/core": "^3.7.0",
    "@ionic-native/date-picker": "^3.4.4",
    "@ionic-native/deeplinks": "^3.8.1",
    "@ionic-native/file": "^3.4.4",
    "@ionic-native/geolocation": "^3.8.0",
    "@ionic-native/google-plus": "^4.1.0",
    "@ionic-native/http": "^3.4.4",
    "@ionic-native/image-picker": "^3.14.0",
    "@ionic-native/in-app-browser": "^3.13.1",
    "@ionic-native/keyboard": "^3.5.0",
    "@ionic-native/local-notifications": "^3.13.1",
    "@ionic-native/location-accuracy": "^3.8.0",
    "@ionic-native/mixpanel": "^3.12.1",
    "@ionic-native/native-geocoder": "^3.8.0",
    "@ionic-native/photo-viewer": "^3.7.0",
    "@ionic-native/push": "^3.14.0",
    "@ionic-native/social-sharing": "^4.1.0",
    "@ionic-native/splash-screen": "^3.14.0",
    "@ionic-native/status-bar": "^4.0.1",
    "@ionic-native/transfer": "^3.4.4",
    "@ionic/storage": "2.0.1",
    "angular2-elastic": "^0.13.0",
    "angular2-moment": "^1.3.3",
    "animate.css": "^3.5.2",
    "com-sarriaroman-photoviewer": "^1.1.10",
    "cordova-android": "^6.2.3",
    "cordova-browser": "^4.1.0",
    "cordova-ios": "^4.4.0",
    "cordova-plugin-add-swift-support": "^1.6.0",
    "cordova-plugin-app-preferences": "^0.99.3",
    "cordova-plugin-camera": "^2.4.1",
    "cordova-plugin-compat": "^1.1.0",
    "cordova-plugin-console": "^1.0.7",
    "cordova-plugin-datepicker": "^0.9.3",
    "cordova-plugin-device": "^1.1.6",
    "cordova-plugin-facebook4": "^1.9.1",
    "cordova-plugin-file": "^4.3.3",
    "cordova-plugin-file-transfer": "^1.6.3",
    "cordova-plugin-filepath": "^1.0.2",
    "cordova-plugin-geolocation": "^2.4.3",
    "cordova-plugin-googleplus": "^5.1.1",
    "cordova-plugin-http": "^1.2.0",
    "cordova-plugin-inappbrowser": "^1.7.1",
    "cordova-plugin-mixpanel": "^3.1.0",
    "cordova-plugin-nativegeocoder": "^1.0.2",
    "cordova-plugin-nativestorage": "^2.2.2",
    "cordova-plugin-request-location-accuracy": "^2.2.1",
    "cordova-plugin-splashscreen": "^4.0.3",
    "cordova-plugin-statusbar": "git+https://github.com/apache/cordova-plugin-statusbar.git",
    "cordova-plugin-telerik-imagepicker": "^2.1.8",
    "cordova-plugin-whitelist": "^1.3.2",
    "cordova-plugin-x-socialsharing": "^5.2.0",
    "cordova-sqlite-storage": "^2.0.4",
    "de.appplant.cordova.plugin.local-notification": "^0.8.5",
    "engine.io-client": "^3.1.1",
    "es6-promise-plugin": "^4.1.0",
    "geoposition-to-object": "^1.0.2",
    "intl": "1.2.4",
    "ionic-angular": "3.2.0",
    "ionic-native": "2.4.1",
    "ionic-native-http-connection-backend": "^1.2.2",
    "ionic-plugin-deeplinks": "^1.0.15",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionic2-rating": "^1.2.2",
    "ionicons": "3.0.0",
    "jr-crop": "^1.1.2",
    "mkpath": "^1.0.0",
    "moment": "^2.18.1",
    "moment-es6": "^1.0.0",
    "ng2-simple-global": "^1.2.4",
    "node-version-compare": "^1.0.1",
    "paypal-checkout": "^4.0.95",
    "phonegap-plugin-push": "^1.10.5",
    "plist": "^2.1.0",
    "rxjs": "5.1.1",
    "socket.io-client": "^2.0.3",
    "socket.io-parser": "^3.1.2",
    "sw-toolbox": "3.6.0",
    "underscore": "^1.8.3",
    "zone.js": "0.8.10"
sneas commented 7 years ago

Hi @yossi-shasho. Thanks for opening the issue. v1.2.4 fixes the problem.