Closed SamanthaAdrichem closed 4 years ago
I have the same error, did you find a work around ?
No, i gave up after not getting an answer on stack overflow either. You could check the three linked issues. Hope that solves it for you.
@pcapon I've finally resolved it. The mistake on our side was that for some reason we're exporting the UIRouterUpgradeModule. That's a big no-no
exports: [ UIRouterUpgradeModule ],
If you're still stuck and can provide a demo repository, i'm glad to help! Otherwise compare your repository with their demo or mine
@oobleck, thanks for the thumbsdown ;) But in my defence, i'd been working on it for over a week and there was no reply anywhere. Been contacting people on a lot of sides.
@SamanthaAdrichem it was meant as a sympathetic gesture. 😊
Your shared links were actually very helpful
Thanks @SamanthaAdrichem. I was also running into this issue and I did the same mistake as you
oobleck Hehe no problem.
And aroop, your welcome.
I actually managed to break it again today, for people finding this issue. You cannot inject the TransitionService in the app.module.ts, you'll get the same error.
I was trying to add a loader for lazy loaded childs, well the solution is do that in the angular js main controller until hybrid is gone
We've followed the instructions, and all runs fine on normal hybrid, but adding lazy loading fails with the strange error above, and always implemented ui router the way the docs say (as you can see in the code below).
When loading the app all is fine, but when then clicking onto a lazy-loaded route we get the error
I've tried the solutions listed here https://github.com/ui-router/angular-hybrid/issues/93 https://github.com/ui-router/angular-hybrid/issues/150 https://github.com/ui-router/angular-hybrid/issues/395 https://github.com/ui-router/sample-app-angular-hybrid/issues/10
But none of these solve it. We don't use ng serve because that crashes with random memory issues (probably also due to hybrid), and we need to proxy to a login page, but the login page and our project would be running on the same port, which isn't possible. So that needs some refactoring in the backend.
It does sometimes load a new chunk file depending on what page i'm going to. But mostly i get this error.
Funny part is, in the page i'm testing we're not using any hybrid code. Basically we're are no longer upgrading any code, we're only downgrading some observers to open modals of the older pages.
These are the versions we're running
Below the detailed error and some code, don't know what else to share or what i can safely share.
Any suggestions on how to debug this would be lovely!
[EDIT]: Running it on ng-serve with only minimal webpack config (loading po files and such), causes the same issue.
detailed error
Our main.ts
Our app.module.ts
The admin-routing.module.ts
And then the admin module
and for example search.module
with search routing module as you can see not yet lazy loaded, when that will be introduced we would include search-routing module inside the admin module and refer to the search module in the routing module
Our angularjs module
and main app.controller