Angular-cli: Production version with angular 2.2.0 throws runtime errors during bootstrapping

Created on 17 Nov 2016  Â·  11Comments  Â·  Source: angular/angular-cli

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Ubuntu 14.04

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.20-4
node: 6.2.0
os: linux x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

I have fully working project created with cli and using angular 2.1.0 and angular-cli beta 20-4. But after updating to angular 2.2.0 I noticed that the prod version is broken (dev works fine). I don't use aot. Switching back to angular 2.1.2 solves the problem

The log given by the failure.

Normally this include a stack trace and some more information.

main.a82a595ec03ac1564c9b.bundle.js:1272 TypeError: Cannot read property 'appendChild' of null
at appendChild (http://localhost:4200/main.a82a595ec03ac1564c9b.bundle.js:949:1099)
at View_t2.visitRootNodesInternal (/t/t/component.ngfactory.js:1022:3)
at View_t2.t._renderAttach (http://localhost:4200/main.a82a595ec03ac1564c9b.bundle.js:1942:3886)
at View_t2.t.attachAfter (http://localhost:4200/main.a82a595ec03ac1564c9b.bundle.js:1942:3293)
at t.attachView (http://localhost:4200/main.a82a595ec03ac1564c9b.bundle.js:1949:1905)
at t.insert (http://localhost:4200/main.a82a595ec03ac1564c9b.bundle.js:1321:1931)
at t.createEmbeddedView (http://localhost:4200/main.a82a595ec03ac1564c9b.bundle.js:1321:1535)
at t.set [as ngIf] (http://localhost:4200/main.a82a595ec03ac1564c9b.bundle.js:1578:211)
at Wrapper_t.check_ngIf (/t/t/wrapper.ngfactory.js:17:23)
at proxyViewClass.View_t0.detectChangesInternal (/t/t/component.ngfactory.js:468:16)t.handleError @ main.a82a595ec03ac1564c9b.bundle.js:1272
main.a82a595ec03ac1564c9b.bundle.js:2196 TypeError: Cannot read property 'appendChild' of null(…)i @ main.a82a595ec03ac1564c9b.bundle.js:2196

Mention any other details that might be useful.

I know you would prefer a project with reproducible error but mine is rather big already and closed source, so I don't know if I'm able to provide the smallest possible code with reproducible error, but maybe you have an Idea what could have broken the prod builds in 2.2.0

Most helpful comment

Guys, try to avoid "same here" comments. The link to the real issue was given above, subscribe to that ticket in angular bugtracker and follow the changes

All 11 comments

Hey guys!

Same error here, when you run your solution in dev environment with "ng serve" it works properly, but when you run it in production environment with "ng serve --prod" I am getting the error message mentioned above.

I am using:
Angular2: 2.2.0
angular-cli: ^1.0.0-beta.20-4
node: v7.1.0

Thanks a lot in advance for any help provided!

Regards.

Hey,

Same problem here! when deploying for production using webpack the app does not work. The data is being loaded but the view does not get updated, and getting the error provided above.
I am using:
@angular/**: 2.2.0
"webpack": "1.13.3"
node: 6.9.1

Thanks for your help!

It is angular2 bug.

is it reported already? can you share a link?

thank you

I am facing the same issue.

Same here too

Guys, try to avoid "same here" comments. The link to the real issue was given above, subscribe to that ticket in angular bugtracker and follow the changes

2.2.1 should be out with the fix.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings