--prod build fails on UglifyJs with "undefined" error message on es5
See original GitHub issueBug 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
Issue Analytics
- State:
- Created 5 years ago
- Comments:11
Top Results From Across the Web
angular - ng build --prod ERROR from UglifyJs - Stack Overflow
I google and find some solve way that change "target": "es5" in tsconfig.json file but the target is es5 by default. I have...
Read more >UglifyJs error on production build - sage - Roots Discourse
When building a production build I get this error: scripts/main_0282ea08.js from UglifyJs Unexpected token: operator (>) [scripts/main_0282ea08.js:471,43].
Read more >How to Bundle JavaScript With Rollup — Step-by-Step Tutorial
This week, we're going to build our first project using Rollup, which is a build tool for bundling JavaScript (and stylesheets, but we'll...
Read more >How I Fixed: UglifyJs Unexpected token: name (DropIn)
I've been trying – in vain – to build the front end for CodeReviewVideos. The issue I have been hitting upon is as...
Read more >TerserWebpackPlugin | webpack
Use multi-process parallel running to improve the build speed. ... packageJson = require("uglify-module/package.json"); } catch (error) { // Ignore } return ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
everyone having this error, see the referenced issue in tether HubSpot/tether/issues/295
to get your apps working again lower the version from
1.4.5
to1.4.4
removing tether dependency and removing it from scripts[] fixed my issue, I don’t need it as bootstrap 4 depends only on popper.js. But still the error is confusing