10.1.0 i18n compilation error: Localized bundle generation failed: Cannot read property 'value' of undefined
See original GitHub issue🐞 bug report
Affected Package
Angular 10.1.0
Is this a regression?
Yes, no issues with 10.0.x (all of them)
Description
Upgrading our project to 10.1.0
ng update @angular/core @angular/cli --force
No issues, upgrade goes through without issues.
However, when doing a production build I get this error:
Localized bundle generation failed: Cannot read property 'value' of undefined
I am using i18n with 3 languages.
🌍 Your Environment
Angular Version:
Angular CLI: 10.0.8
Node: 12.13.1
OS: darwin x64
Angular: 10.1.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router, service-worker
Ivy Workspace: <error>
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.1000.8
@angular-devkit/build-angular 0.1000.8
@angular-devkit/build-optimizer 0.1000.8
@angular-devkit/build-webpack 0.1000.8
@angular-devkit/core 10.0.8
@angular-devkit/schematics 10.0.8
@angular/cdk 10.0.1
@angular/cli 10.0.8
@angular/fire 6.0.2
@angular/material 10.0.1
@angular/material-moment-adapter 10.0.1
@ngtools/webpack 10.0.8
@schematics/angular 9.1.6
@schematics/update 0.1000.8
rxjs 6.5.5
typescript 3.9.6
webpack 4.43.0
🌍 angular.json
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"selfservice": {
"i18n": {
"locales": {
"da": "src/locale/messages.da.xlf",
"sv": "src/locale/messages.sv.xlf",
"en": "src/locale/messages.en.xlf"
}
},
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {
"@schematics/angular:component": {
"style": "sass"
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/robots.txt",
"src/favicon.png",
"src/assets",
"src/browserconfig.xml",
"src/manifest.json",
{
"glob": "**/*",
"input": "./assets",
"output": "assets/"
}
],
"styles": [
"./node_modules/material-icons/iconfont/material-icons.scss",
"src/styles/index.scss"
],
"scripts": [
"./node_modules/file-saver/dist/FileSaver.min.js",
"src/assets/js/modernizr.js"
]
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"localize": [
"da", "sv", "en"
],
"optimization": true,
"outputHashing": "bundles",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": true,
"buildOptimizer": true,
"serviceWorker": true,
"outputPath": "dist"
},
"da": {
"aot": true,
"localize": [
"da"
],
"outputPath": "dist"
},
"sv": {
"aot": true,
"localize": [
"sv"
],
"outputPath": "dist"
},
"en": {
"aot": true,
"localize": [
"en"
],
"outputPath": "dist"
},
"integration": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.integration.ts"
}
],
"aot": true,
"localize": [
"en"
],
"outputPath": "dist"
},
"staging": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.staging.ts"
}
],
"localize": [
"da", "sv", "en"
],
"optimization": true,
"outputHashing": "bundles",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": true,
"buildOptimizer": true,
"serviceWorker": true,
"outputPath": "dist"
},
"test": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.test.ts"
}
],
"localize": [
"da", "sv", "en"
],
"optimization": true,
"outputHashing": "bundles",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": true,
"buildOptimizer": true,
"serviceWorker": true,
"outputPath": "dist"
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "selfservice:build"
},
"configurations": {
"production": {
"browserTarget": "selfservice:build:production"
},
"integration": {
"browserTarget": "selfservice:build:integration"
},
"da": {
"browserTarget": "selfservice:build:da"
},
"sv": {
"browserTarget": "selfservice:build:sv"
},
"en": {
"browserTarget": "selfservice:build:en"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "selfservice:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"src/styles.sass"
],
"scripts": [],
"assets": [
"src/favicon.ico",
"src/assets",
"src/manifest.json"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"selfservice-e2e": {
"root": "e2e/",
"projectType": "application",
"prefix": "",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "selfservice:serve"
},
"configurations": {
"production": {
"devServerTarget": "selfservice:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "selfservice",
"cli": {
"analytics": "e39974f2-c043-437e-ad6b-c5bb38cf1079"
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:26 (10 by maintainers)
Top Results From Across the Web
Angular 10.2 build: Localized bundle generation failed
Localized bundle generation failed. Cannot read properties of undefined (reading 'includes'). After change removed sourceMap property ...
Read more >angular comple and build problem - Genuitec
I get the following error: Localized bundle generation failed: Cannot read property 'cooked' of undefined. Do you know how to fix this?
Read more >Bug listing with status RESOLVED with resolution TEST ...
Bug:233 - "Emacs segfaults when merged through the sandbox." status:RESOLVED resolution:TEST-REQUEST severity:critical · Bug:3888 - "yenta_socket module not ...
Read more >Changelog - Cypress Documentation
Cypress no longer throws the error "cannot read property split of undefined" in certain circumstances when application errors are thrown. Fixes #17378.
Read more >cannot read properties of undefined (reading 'data') axios
It takes time for the api to respond, so at the start model is assigned the value of the parameter you passed to...
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 FreeTop 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
Top GitHub Comments
i had the same error using cli 10. after upgrading cli to 10.1 the problem has gone!
I used this to fix:
ng update @angular-devkit/build-angular
^^