Skip to content

Production version with angular 2.2.0 throws runtime errors during bootstrapping #3175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chpasha opened this issue Nov 17, 2016 · 11 comments
Closed

Comments

@chpasha
Copy link

chpasha commented Nov 17, 2016

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

@surfercoder
Copy link

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.

@chpasha chpasha closed this as completed Nov 17, 2016
@chpasha chpasha reopened this Nov 17, 2016
@ASK83
Copy link

ASK83 commented Nov 17, 2016

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!

@michalstepien
Copy link

It is angular2 bug.

@chpasha
Copy link
Author

chpasha commented Nov 17, 2016

is it reported already? can you share a link?

@michalstepien
Copy link

Yes It is reported. angular/angular#12911

@chpasha
Copy link
Author

chpasha commented Nov 17, 2016

thank you

@naveedahmed1
Copy link

I am facing the same issue.

@patrickoneill46
Copy link

Same here too

@chpasha
Copy link
Author

chpasha commented Nov 17, 2016

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

@clydin
Copy link
Member

clydin commented Nov 17, 2016

2.2.1 should be out with the fix.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants