Skip to content

Production build broken since RC6 upgrade. #2007

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
asadsahi opened this issue Sep 7, 2016 · 10 comments
Closed

Production build broken since RC6 upgrade. #2007

asadsahi opened this issue Sep 7, 2016 · 10 comments

Comments

@asadsahi
Copy link

asadsahi commented Sep 7, 2016

production build is erroring because of an undefined script

image

When running ng build --prod, it ended up in following error:

image

Upgraded to Angular 2 RC6 with following environment details:
angular-cli: 1.0.0-beta.11-webpack.8
node: 6.3.1
os: win32 x64

@billdwhite
Copy link

Same here

@hassanasad
Copy link

Same here.

However i noticed that ng build --env=prod does work. I believe it doesn't minify the code though. I researched the error and seems to be a webpack issue.

@asadsahi
Copy link
Author

asadsahi commented Sep 8, 2016

@hassanasad its strange that --env=prod doesn't create production build :).
ng build --env=prod doesn't seem to be a valid command, docs have following as production commands:

ng build --target=production --environment=prod
ng build --prod --env=prod
ng build --prod

ng build createst the same build, so I am not sure if --env=prod is a valid flag or there is some issue with cli.

@coryrylan
Copy link
Contributor

I believe this was an issue with webpack that has been resolved. This should be fixed with the next update.
#2011

@hansl
Copy link
Contributor

hansl commented Sep 13, 2016

You're misinterpretting two concepts: env and target. What ng build --prod does is equivalent to ng build --env=prod --target=prod. The --env only dictates which environment file it's using. This allows you to build and debug development code with prod environment.

I'm looking at this. Never seen it before. Is it an open source projet I could repro with?

@asadsahi
Copy link
Author

asadsahi commented Sep 13, 2016

@hansl I have upgraded it to RC7, but I think you should be able to replicate this issue from one of my repo. Above error was from the same repo.

@hansl
Copy link
Contributor

hansl commented Sep 13, 2016

There's something wrong with your global / local versions of Angular CLI. I got it working locally the first try; literally just git clone, npm install then ng serve.

@hansl
Copy link
Contributor

hansl commented Sep 13, 2016

Actually nevermind, just found the error when running prod. Investigating.

@hansl
Copy link
Contributor

hansl commented Sep 13, 2016

Okay found the bug. This is already fixed by #1937.

@hansl hansl closed this as completed Sep 13, 2016
@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

5 participants