x)
- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Yes, the previous version in which this bug was not present was:
@angular-devkit/build-angular:v0.803.3
A clear and concise description of the problem...
Build fails with the latest @angular-devkit/build-angular:v0.803.4 if optimization is enabled i.e.
ng build --optimization=true
I tried to create a new app to reproduce it without success yet and I am afraid I cannot share the repo either.
But I did some digging and it seems related to fix 7a75c4cd215f06986b31afd85018ba918533a38d and differential loading. If I set my browserlist to last 1 Chrome versions the build is OK.
[error] SyntaxError: /home/panos/ui/dist/vendor-es2015.js: Unexpected reserved word 'arguments' (1:2704314)
[0m[31m[1m>[22m[39m[90m 1 | [39m(window[33m.[39mwebpackJsonp[33m=[39mwindow[33m.[39mwebpackJsonp[33m||[39m[])[33m.[39mpush([[[35m21[39m][33m,[39m{[32m"/Co4"[39m[33m:[39m[36mfunction[39m(module[33m,[39m__webpack_exports__[33m,[39m__webpack_require__){[32m"use strict"[39m[33m;[39m__webpack_require__[33m.[39md(__webpack_exports__[33m,[39m[32m"a"[39m[33m,[39m[36mfunction[39m(){[36mreturn[39m [33mMatAutocomplete[39m})[33m,[39m__webpack_require__[33m.[39md(__webpack_exports__[33m,[39m[32m"b"[39m[33m,[39m[36mfunction[39m(){[36mreturn[39m [33mMatAutocompleteModule[39m})[33m,[39m__webpack_require__[33m.[39md(__webpack_exports__[33m,[39m[32m"c"[39m[33m,[39m[36mfunction[39m(){[36mreturn[39m [33mMatAutocompleteTrigger[39m})[33m;[39m[36mvar[39m _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_0__[33m=[39m__webpack_require__([32m"5GAg"[39m)[33m,[39m_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_1__[33m=[39m__webpack_require__([32m"KCVW"[39m)[33m,[39m_angular_core__WEBPACK_IMPORTED_MODULE_2__[33m=[39m__webpack_require__([32m"8Y7J"[39m)[33m,[39m_angular_material_core__WEBPACK_IMPORTED_MODULE_3__[33m=[39m__webpack_require__([32m"Xd0L"[39m)[33m,[39m_angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_4__[33m=[39m__webpack_require__([32m"IP0z"[39m)[33m,[39m_angular_cdk_keycodes__WEBPACK_IMPORTED_MODULE_5__[33m=[39m__webpack_require__([32m"dvZr"[39m)[33m,[39m_angular_cdk_overlay__WEBPACK_IMPORTED_MODULE_6__[33m=[39m__webpack_require__([32m"QQfA"[39m)[33m,[39m_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_7__[33m=[39m__webpack_require__([32m"/HVE"[39m)[33m,[39m_angular_cdk_portal__WEBPACK_IMPORTED_MODULE_8__[33m=[39m__webpack_require__([32m"zMNK"[39m)[33m,[39m_angular_cdk_scrolling__WEBPACK_IMPORTED_MODULE_9__[33m=[39m__webpack_require__([32m"hOhj"[39m)[33m,[39m_angular_common__WEBPACK_IMPORTED_MODULE_10__[33m=[39m__webpack_require__([32m"SVse"[39m)[33m,[39m_angular_forms__WEBPACK_IMPORTED_MODULE_11__[33m=[39m__webpack_require__([32m"s7LF"[39m)[33m,[39m_angular_material_form_field__WEBPACK_IMPORTED_MODULE_12__[33m=[39m__webpack_require__([32m"HsOI"[39m)[33m,
Angular CLI: 8.3.4
Node: 12.10.0
OS: linux x64
Angular: 8.2.6
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.803.4
@angular-devkit/build-angular 0.803.4
@angular-devkit/build-optimizer 0.803.4
@angular-devkit/build-webpack 0.803.4
@angular-devkit/core 8.3.4
@angular-devkit/schematics 8.3.4
@angular/cdk 8.2.0
@angular/cli 8.3.4
@angular/flex-layout 8.0.0-beta.27
@angular/material 8.2.0
@ngtools/webpack 8.3.4
@schematics/angular 8.3.4
@schematics/update 0.803.4
rxjs 6.5.3
typescript 3.5.3
webpack 4.39.2
Anything else relevant?
If possible could you try changing lines 261 & 274 in
node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/common.js
to read ecma: 5, instead of ecma: wco.supportES2015 ? 6 : 5,?
Also could you provide the output of either npm ls terser or yarn list --pattern terser?
@clydin yes it did the trick, no errors after your suggested edits
The output of npm ls terser
[email protected] /home/panos/ui
βββ¬ @angular-devkit/[email protected]
βββ [email protected]
βββ¬ [email protected]
βββ [email protected] deduped
Thanks for looking into this and let me know if you need any more info.
I have just updated build-angular too and it fails with the same message (also it is printing the whole minified string main.js bundle in the console - one gigantic string - which is not useful at all).
We are using Heap and Smartlook analytics, and it's their official init scripts in our index.html files that are failing because they do use "arguments" keyword.
Having the same issue with our application after finally upgrading it from Angular 7 to 8.
When I changed the lines in common.js to ecma: 5, per @clydin comment, the build executed without any errors.
I'm still hitting this problem in v0.803.5 and no later version appears to be available on NPM - is that expected? For now I've just rolled back to v0.803.3.
Patch releases are generally released every Wednesday. This will be in .6.
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._