ui-router icon indicating copy to clipboard operation
ui-router copied to clipboard

error: 'Right-hand side of 'instanceof' is not an object' after updating to 2.0.0

Open kolkov opened this issue 10 years ago • 11 comments

Hi! After upgrading to 2.0.0 I got a error:

image

and in the:

@UIRouterModule({
  imports: [
    CommonModule,
    NgbModule,
    FormsModule,
  ], 

image

image

kolkov avatar Sep 16 '16 17:09 kolkov

I think this was fixed by 7c54b751bf25f3f07250bc9769917d58b1d30934

christopherthielen avatar Sep 17 '16 06:09 christopherthielen

Getting same error with 1.0.0-beta.2 .

erik-ropez avatar Sep 20 '16 09:09 erik-ropez

Is there workaround for this? Cannot find what exactly in my app is causing this issue. Commented out almost everything in my app but still getting this error. Is this error happens to everyone using 1.0.0-beta.2 or there is something specific in configuration, etc.?

erik-ropez avatar Sep 20 '16 09:09 erik-ropez

@erik-rope, what version of typescript you are using?

kolkov avatar Sep 20 '16 09:09 kolkov

@kolkov I'm actually not using TS. Using ES6 instead. How is it related?

erik-ropez avatar Sep 20 '16 09:09 erik-ropez

Angular 2.0.0 removed all the *MetaData classes. We were checking instanceof ComponentMetadata, but ComponentMetadata is undefined in 2.0.0.

https://github.com/angular-ui/ui-router/commit/7c54b751bf25f3f07250bc9769917d58b1d30934#commitcomment-19100421

This hasn't been released, but will be as beta.3 (later this week, probably)

christopherthielen avatar Sep 20 '16 17:09 christopherthielen

@erik-ropez you can either:

  • wait for beta.3 and stay on angular 2.0.0-rc.6
  • build ui-router-ng2 off master today

christopherthielen avatar Sep 20 '16 17:09 christopherthielen

@christopherthielen, tried to build but failed with #3025.

erik-ropez avatar Sep 21 '16 08:09 erik-ropez

Thanks! Fixed with new version.

kolkov avatar Sep 21 '16 16:09 kolkov

@erik-ropez if you're still having trouble building, I built latest master:

https://rawgit.com/christopherthielen/4170db48d3cafd3dc5948042fdaa7312/raw/54f4910fdca5c9c6afb5eddee3d6fc2476d73c4c/ui-router-ng2.js

christopherthielen avatar Sep 21 '16 16:09 christopherthielen

in Angular6 am getting below error image

ravind996 avatar Aug 08 '18 12:08 ravind996