ionic-framework: Some errors on test migration to ionic3, ionic-cli 3.beta4, ionic-angular 2.2.0-201703211421 and angular4 rc.5

Ionic version: (check one with “x”) [ ] 1.x [ ] 2.x [x] 3.x

I’m submitting a … (check one with “x”) [x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior: I try to use your latest ionic angular version which you merged yesterday with the 3.0 branch, so I’m trying to migrate my app on angular4 rc.5 By the way, I’m interested to beta test your new ionic3 with now IonicPage (DeepLink) over ionic4 👍

There are two bugs:

  1. the Custom Error Handler does not work as in version 2, on declaring the provider for Custom Error Handler in app.component.ts { provide: ErrorHandler, useClass: LanthingsErrorHandler, deps: [ ToastController ] }, we get this error
polyfills.js:3 Unhandled Promise rejection: Class constructor IonicErrorHandler cannot be invoked without 'new' ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Class constructor IonicErrorHandler cannot be invoked without 'new'(…) TypeError: Class constructor IonicErrorHandler cannot be invoked without 'new'
    at new LanthingsErrorHandler (http://localhost:8100/build/main.js:108840:28)
    at AppModuleInjector.createInternal (ng:///AppModule/module.ngfactory.js:244:26)
    at AppModuleInjector.NgModuleInjector.create (http://localhost:8100/build/main.js:3591:76)
    at NgModuleFactory.create (http://localhost:8100/build/main.js:3564:18)
    at http://localhost:8100/build/main.js:4760:61
    at t.invoke (http://localhost:8100/build/polyfills.js:3:14738)
    at Object.onInvoke (http://localhost:8100/build/main.js:4151:37)
    at t.invoke (http://localhost:8100/build/polyfills.js:3:14678)
    at n.run (http://localhost:8100/build/polyfills.js:3:9950)
    at NgZone.run (http://localhost:8100/build/main.js:4020:62)
    at PlatformRef_._bootstrapModuleFactoryWithZone (http://localhost:8100/build/main.js:4758:23)
    at http://localhost:8100/build/main.js:4800:59
    at t.invoke (http://localhost:8100/build/polyfills.js:3:14738)
    at n.run (http://localhost:8100/build/polyfills.js:3:9950)
    at http://localhost:8100/build/polyfills.js:3:6647
  1. the other error we get is on a Custom HTTPService
export function httpFactory(backend: XHRBackend, options: RequestOptions, platform: Platform) {
  return new HttpService(backend, options, platform);
}

...
providers: [
      {
          provide: HttpService,
          useFactory:  httpFactory,
          deps: [XHRBackend, RequestOptions, Platform ]
        },

we get this error

polyfills.js:3 Unhandled Promise rejection: No provider for XHRBackend! ; Zone: <root> ; Task: Promise.then ; Value: Error: No provider for XHRBackend!(…) Error
    at y (http://localhost:8100/build/polyfills.js:3:7590)
    at injectionError (http://localhost:8100/build/main.js:1426:86)
    at noProviderError (http://localhost:8100/build/main.js:1464:12)
    at ReflectiveInjector_._throwOrNull (http://localhost:8100/build/main.js:2908:19)
    at ReflectiveInjector_._getByKeyDefault (http://localhost:8100/build/main.js:2947:25)
    at ReflectiveInjector_._getByKey (http://localhost:8100/build/main.js:2879:25)
    at ReflectiveInjector_.get (http://localhost:8100/build/main.js:2748:21)
    at AppModuleInjector.get (ng:///AppModule/module.ngfactory.js:206:99)
    at AppModuleInjector.get (ng:///AppModule/module.ngfactory.js:211:95)
    at AppModuleInjector.getInternal (ng:///AppModule/module.ngfactory.js:442:51)
    at AppModuleInjector.NgModuleInjector.get (http://localhost:8100/build/main.js:3610:44)
    at resolveDep (http://localhost:8100/build/main.js:10702:45)
    at createClass (http://localhost:8100/build/main.js:10570:32)
    at createDirectiveInstance (http://localhost:8100/build/main.js:10386:37)
    at createViewNodes (http://localhost:8100/build/main.js:11712:49)

Expected behavior:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

    Cordova CLI: 6.5.0 
    Ionic Framework Version: 2.2.0-201703211421
    Ionic CLI Version: 3.0.0-beta.4
    ios-deploy version: Not installed
    ios-sim version: Not installed
    OS: Linux 4.8
    Node Version: v6.10.0
    Xcode version: Not installed

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 18 (17 by maintainers)

Most upvoted comments

I found the mistake!!!

For the HTTP bug I didn’t include HttpModule in app.module.ts, doing this it works now. Now we need this, probably in ionic2 the httpmodule was included out of the box, because this was also needed before I think from angular 2.2.X or 2.4.x

For the problem with the custom ErrorHanlder, now in ionic 3.0.0 it is working out of the box without bug.

So anything is fine 😄 👍

@AmitMY I also use very heavy ion-grid, so this is for now not working as expected? So I have to wait for migration until the team resolves this issue.

I need urgent v3 for lazy-loading, we all need v3 for lazy-loading 😄

Perhaps you can open an new issue for this