Skip to content

Version 10 breaks with angular-cli buildOptimizer+optimization #382

@oBusk

Description

@oBusk

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions