Skip to content

--prod build fails on UglifyJs with "undefined" error message on es5 #12506

@RemiBou

Description

@RemiBou

Bug Repor

- [x] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

node --version : 5.1.0

ng --version

 / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 6.2.4
Node: 8.11.3
OS: darwin x64
Angular: 5.2.11
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.8.4
@angular-devkit/build-angular     0.8.4
@angular-devkit/build-optimizer   0.8.4
@angular-devkit/build-webpack     0.8.4
@angular-devkit/core              0.8.4
@angular-devkit/schematics        0.8.4
@angular/cli                      6.2.4
@angular/language-service         4.4.7
@ngtools/webpack                  6.2.4
@schematics/angular               0.8.4
@schematics/update                0.8.4
rxjs                              5.5.12
typescript                        2.4.2

Repro steps

I run "ng build --prod".

The log given by the failure

Date: 2018-10-08T08:32:05.461Z
Hash: 74f0598df6b8233262d2
Time: 25640ms
chunk {scripts} scripts.b8e8114c722336f4e67f.js (scripts) 525 kB [rendered]
chunk {0} runtime.ec2944dd8b20ec099bf3.js (runtime) 1.44 kB [entry] [rendered]
chunk {1} main.3d4547cca3b3a51145ac.js (main) 1.79 MB [initial] [rendered]
chunk {2} polyfills.fdb7818e5a930dae1ea1.js (polyfills) 103 kB [initial] [rendered]
chunk {3} styles.73c5b4cf018b22bdc892.css (styles) 1.17 MB [initial] [rendered]

ERROR in scripts.b8e8114c722336f4e67f.js from UglifyJs
undefined

Desired functionality

Build succeeds without error.

Mention any other details that might be useful

  • it works without "--prod"
  • it works if I change "target" to "es2015" in src/tsconfig.app.json (now it's "es5") but I don't want to loose IE11 support now.
  • I tried "--source-map" but it did not give more informations

thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: repro stepsWe cannot reproduce the issue with the information given

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions