ui-router / angular-hybrid

Upgrade an ng1 UI-Router app to a ng1+ng2 hybrid using ng-upgrade
MIT License
167 stars 75 forks source link

Error bootstrapping AppModule Error: Cannot read properties of undefined (reading 'when') #573

Closed jozzeed closed 1 year ago

jozzeed commented 1 year ago

I tried implementing @ui-router/angular-hybrid in my angular 12 app and encountered the following error while bootstrapping: "Error bootstrapping AppModule Error: Cannot read properties of undefined (reading 'when')". This seems to be coming from the $q and an issue importing the services.

At first I thought this was on my end but after some tuning I was able to reproduce the issue in the following stackblitz.io

From the other issues I have seen, it seems to be coming from having multiple dependencies to @uirouter/core. However, I am unsure how to solve the issue. I tried with angular 13 and 14 (with the updated packages) but the result is the same

Any idea?

wawyed commented 1 year ago

Please have a look at https://github.com/ui-router/angular-hybrid/tree/master/example Just tested it and seems to be working fine. Reopen if you still have issues.