Skip to content

Production build broken since RC6 upgrade. #2007

Closed

Description

@asadsahi

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

Activity

  1. billdwhite commented on Sep 7, 2016

    @billdwhite

    Same here

  2. hassanasad commented on Sep 8, 2016

    @hassanasad

    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.

  3. asadsahi commented on Sep 8, 2016

    @asadsahi
    Author

    @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.

  4. coryrylan commented on Sep 8, 2016

    @coryrylan
    Contributor

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

  5. hansl commented on Sep 13, 2016

    @hansl
    Contributor

    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?

  6. asadsahi commented on Sep 13, 2016

    @asadsahi
    Author

    @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.

  7. hansl commented on Sep 13, 2016

    @hansl
    Contributor

    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.

  8. hansl commented on Sep 13, 2016

    @hansl
    Contributor

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

  9. hansl commented on Sep 13, 2016

    @hansl
    Contributor

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

  10. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    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.

  11. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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