Closed
Description
🐞 Bug report
Command (mark with an x
)
- new
- build
- prerender
- serve
- test
- e2e
- generate
- add
- update
- lint
- extract-i18n
- run
- config
- help
- version
- doc
Is this a regression?
Yes, it worked in angular 11.
Description
Angular build fails with message:
✖ Localized bundle generation failed: /path/to/project/main.js: Unexpected reserved word 'let'. (1:2980997)
An error occurred inlining file "main.js"
Issue feels similar to this one, i.e. that some dependency has a strange coding pattern.The error refers to "main.js", which I presume is stored in memory. Is there a way to save this to disk? If so, I can search it to find the exact violating code.
Suspect list:
- Babel
- Localization
- Server side rendering (universal)
- Pre-rendering
🔬 Minimal Reproduction
- ng new loc-error
- ng add @angular/localize
- ng add @nguniversal/express-engine
- Add "localize": true to angular.json for server and browser build targets
- Add "serverTarget": "loc-error:server:production" to prerender step
- yarn prerender
Link to minimal repository with this setup:
https://github.com/submarines-and/angular-localization-error
🔥 Exception or Error
🌍 Your Environment
Angular CLI: 12.0.0
Node: 14.15.5
Package Manager: npm 6.14.11
OS: darwin x64
Angular: 12.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic
... platform-server, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1200.0
@angular-devkit/build-angular 12.0.0
@angular-devkit/core 12.0.0
@angular-devkit/schematics 12.0.0
@nguniversal/builders 12.0.0
@nguniversal/express-engine 12.0.0
@schematics/angular 12.0.0
rxjs 6.6.7
typescript 4.2.4
Localization on
Server side rendering (universal) on
Pre-rendering on.
yarn version 1.22.10