-
Notifications
You must be signed in to change notification settings - Fork 77
Description
So after the upgrade to @uirouter/angular-hybrid@10.0.0
, we're getting issues whenever running with --prod
. Build is fine, but when running app gets;
TypeError: Cannot read property 'subscribe' of undefined
at new t (main.41a1ba9f91d11bc569f1.js:formatted:113389)
at qr (main.41a1ba9f91d11bc569f1.js:formatted:99813)
at Wr (main.41a1ba9f91d11bc569f1.js:formatted:99756)
at Bs (main.41a1ba9f91d11bc569f1.js:formatted:101757)
at Object.Fs [as createEmbeddedView] (main.41a1ba9f91d11bc569f1.js:formatted:101678)
at e.createEmbeddedView (main.41a1ba9f91d11bc569f1.js:formatted:99454)
at t.createEmbeddedView (main.41a1ba9f91d11bc569f1.js:formatted:99278)
at t._updateView (main.41a1ba9f91d11bc569f1.js:formatted:109315)
at t.set [as ngIf] (main.41a1ba9f91d11bc569f1.js:formatted:109287)
at Zr (main.41a1ba9f91d11bc569f1.js:formatted:99884)
Which I've managed to identify to be this line in @uirouter/angular
.
I set up a simple angular-hybrid example to try to identify the problem, and with this project I get;
main.6b5af00a46ac95f21a36.js:1 Error: [$injector:unpr] Unknown provider: class t{}DirectiveProvider <- class t{}Directive
https://errors.angularjs.org/1.7.9/$injector/unpr?p0=class%20t%7B%7DDirectiveProvider%20%3C-%20class%20t%7B%7DDirective
at main.6b5af00a46ac95f21a36.js:1
at main.6b5af00a46ac95f21a36.js:1
at Object.u [as get] (main.6b5af00a46ac95f21a36.js:1)
at main.6b5af00a46ac95f21a36.js:1
at Object.u [as get] (main.6b5af00a46ac95f21a36.js:1)
at main.6b5af00a46ac95f21a36.js:1
at t.makeComponentTemplate (main.6b5af00a46ac95f21a36.js:1)
at t.getTemplate (main.6b5af00a46ac95f21a36.js:1)
at Object.<anonymous> (main.6b5af00a46ac95f21a36.js:1)
at main.6b5af00a46ac95f21a36.js:1 "<ui-view class="ng-scope">"
It appears as if UIRouter is trying to render a Angular view as a AngularJS view.
Configurations and their successes
-
@angular/*@8.2.14
+@ui-router/angular-hybrid@9.0.0
- Works
--prod
Works
-
@angular/*@8.2.14
+@ui-router/angular-hybrid@10.0.0
- Works
--prod
Does not workoptimization: true
Worksaot: true
Worksaot: true
buildOptimizer: true
Worksaot: true
buildOptimizer: true
optimization: true
Does not work--prod
withbuildOptimizer: false
Works
-
@angular/*@9.0.0-4c.4
+@ui-router/angular-hybrid@10.0.0
- Works
--prod
Does not work--prod
withbuildOptimizer: false
Works
-
@angular/*@9.0.0-4c.4
+@ui-router/angular-hybrid@10.0.0
with ivy enabled- Works
--prod
, Does not work--prod
withbuildOptimizer: false
Works
I assume it has something to do with the move to ng-packagr
, but I don't really know how to investigate what is the issue.