Localized bundle generation failed: Cannot read properties of undefined (reading 'value’) on try to localize the app

This issue has been created since 2022-11-24.

Which @angular/* package(s) are the source of the bug?

localize

Is this a regression?

No

Description

I’m trying to build my application using the localization files, but I’m getting the error below when I run ng build --prod sport

Localized bundle generation failed: Cannot read properties of undefined (reading 'value')

This is my angular.json file:

"sport": { "projectType": "application", "schematics": { "@nrwl/angular:component": { "style": "scss" } }, "root": "apps/sport", "sourceRoot": "apps/sport/src", "prefix": "athleta", "i18n": { "sourceLocale": "de", "locales": { "en": "apps/sport/locale/messages.en.xlf" } }, "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { "localize": true, "allowedCommonJsDependencies": [ "localforage-getitems", "util", "hammerjs", "file-saver" ], "outputPath": "dist/apps/sport", "index": "apps/sport/src/index.html", "main": "apps/sport/src/main.ts", "polyfills": "apps/sport/src/polyfills.ts", "tsConfig": "apps/sport/tsconfig.app.json", "aot": true, "assets": [ "apps/sport/src/assets", "apps/sport/src/pwa-manifest.json", "apps/sport/src/silent-renew.html" ], "styles": [ "apps/sport/src/styles.scss" ], "scripts": [] }, "configurations": { "production": { "fileReplacements": [ { "replace": "apps/sport/src/environments/environment.ts", "with": "apps/sport/src/environments/environment.prod.ts" } ], "optimization": true, "outputHashing": "all", "sourceMap": true, "extractCss": true, "namedChunks": false, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": true, "budgets": [ { "type": "initial", "maximumWarning": "2mb", "maximumError": "5mb" }, { "type": "anyComponentStyle", "maximumWarning": "6kb", "maximumError": "10kb" } ] }, "en": { "aot": true, "localize":["en"] }, "e2e": { "fileReplacements": [ { "replace": "apps/sport/src/environments/environment.ts", "with": "apps/sport/src/environments/environment.e2e.ts" } ] } } }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { "browserTarget": "sport:build", "port": 4201 }, "configurations": { "production": { "browserTarget": "sport:build:production" }, "e2e": { "browserTarget": "sport:build:e2e", "port": 0 } } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { "browserTarget": "sport:build" } }, "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { "tsConfig": [ "apps/sport/tsconfig.app.json", "apps/sport/tsconfig.spec.json" ], "exclude": [ "**/node_modules/**", "!apps/sport/**/*" ] } }, "test": { "builder": "@nrwl/jest:jest", "options": { "jestConfig": "apps/sport/jest.config.js", "tsConfig": "apps/sport/tsconfig.spec.json", "passWithNoTests": true, "setupFile": "apps/sport/src/test-setup.ts" } } } },

This is my messages.en.xlf

<?xml version="1.0" encoding="UTF-8" ?> <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> <file source-language="de" datatype="plaintext" original="ng2.template"> <body> <trans-unit id="ee1725f94bc5d74b045c41d3ee0d4e8392c3dad0" datatype="html"> <source>Mein Profil</source> <target>My Profile</target> <context-group purpose="location"> <context context-type="sourcefile">src/app/pages/profile/desktop/profile-desktop.component.html</context> <context context-type="linenumber">5</context> </context-group> </trans-unit> </body> </file> </xliff>

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

`Localized bundle generation failed: Cannot read properties of undefined (reading 'value') `

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 10.0.8
Node: 16.15.1
OS: darwin arm64

Angular: 10.2.5
... animations, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes

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                      8.2.3
@angular/cli                      10.0.8
@angular/material                 8.2.3
@ngtools/webpack                  10.0.8
@schematics/angular               10.0.8
@schematics/update                0.1000.8
rxjs                              6.6.7
typescript                        3.9.10
webpack                           4.43.0

Anything else?

No response

alan-agius4 wrote this answer on 2022-11-24

Hi @avfigueredo,

Angular 10 is no longer supported, see our Support policy and schedule guide.

Please update to the most recent version. If the problem persists in your application after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior. You can use ng new repro-app to create a new project where you reproduce the problem.

More Details About Repo
Owner Name angular
Repo Name angular
Full Name angular/angular
Language TypeScript
Created Date 2014-09-18
Updated Date 2022-12-01
Star Count 85220
Watcher Count 3042
Fork Count 22607
Issue Count 1316

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
`useBottomTabBarHeight` doesn't work 1 2022-11-15 2022-11-20
Fix issues with undividable bitmap sizes 0 2021-07-13 2022-07-18
v0.4.5 nocore 版本无法顺利抓包及解密 3 2022-10-13 2022-11-04
Problem with pagination with Bootstrap 4 templates (xSwatch4 theme) 4 2021-12-20 2022-10-08
[BUG] Status messages not always cleaned up 1 2021-04-11 2022-11-06
Uncoupling in OSC 1 2021-05-06 2022-01-16
patroni deploy problem "Check that the patroni is healthy on the replica server" 16 2021-08-18 2022-11-11
Hide buttons from the UI that viewers don't have permissions to use 2 2022-11-09 2022-11-16
UI bug at the bottom of any 'Project' settings page 0 2022-11-09 2022-11-16
[Unstable 0.18.8.0] Campaign crash on start 4 2022-06-12 2022-11-09
How I can use -stream_loop parameter in this repo? 3 2021-08-09 2022-11-10
Allow editing Exif DateTime 1 2022-01-04 2022-10-30
Resource Manager permissions bug/issue in DNN 9.8.1 and above (HTML Editor Browse Server showing all folders) 25 2021-03-29 2022-11-21
[ISSUE] IPv6 support missing in nflog utility 2 2021-08-16 2022-11-06
Keystroke to cycle between tree pane / list pane / inner address bar ? 10 2021-06-19 2022-11-07
/usr/share/doc/aurutils/examples/vercmp-devel is broken when aur has not been used previously in the session 0 2022-05-27 2022-11-25
Add javascript support for CSVs as strings instead of files 0 2022-08-05 2022-09-14
qtorrent support for multimonitor and HDpi support 1 2022-10-10 2022-10-29
unable to login to web admin console after upgrade 4 2021-08-20 2022-11-10
Tray icon disappears for some icon themes when there are nonzero unread messages 3 2021-10-24 2022-10-27
Maternal inflammatory bowel disease 2 2022-04-07 2022-10-05
Segmented downloads 1 2021-09-08 2022-11-02
Difference in Inference Results on Sample KITTI image Between OpenPCDet and MMDet3D: 2 2021-09-27 2022-11-28
Screen variables changing behavior in renpy8 3 2022-02-03 2022-11-16
Unicode math italics/bold truncates text notes 10 2022-01-31 2022-10-21
server: reduce the memory usage used by `getAllHistoryDDL` 1 2022-06-30 2022-09-11
Broken Link Detected 1 2022-01-26 2022-10-26
[Bug] 'NoneType' object is not subscriptable 14 2021-12-06 2022-09-11
How to add aria-selected=true attibute in the sap.ui.unified.MenuItem or sap.m.MenuItem 3 2022-02-11 2022-11-24
Add a "Fill Color" option to "Object Markers" Just like already exsists in "NPC indicators" 0 2022-04-08 2022-10-13
[Feature request]: Ability to have disabled remotes in /etc/flatpak/remotes.d 0 2022-03-30 2022-09-27
The notebook preview is frozen? 2 2021-03-21 2022-11-11
Plus editor deletes custom stylesheets 6 2021-03-11 2022-11-28
Clang Analysis inputs (expected plists) contain invalid property-list syntax 0 2022-07-05 2022-10-29
How to setup linaria with webpack 5 0 2021-09-15 2022-09-26
tf: dotnet 6 [arm64] support? 15 2022-09-22 2022-11-19
All of my custom directives doesnt working for ssr builds after quasar and vue upgrade 3 2022-04-13 2022-11-16
Create .CSV schema documents for MLAR data 2004-2018 0 2019-04-08 2022-08-11
PngToIcon24 :: ColorBitmap.PixelFormat := pf32bit ?? 1 2022-01-21 2022-10-25
Use SAF to access Android/data folder without root on Android 11+ 2 2021-08-25 2022-11-06
[featurePR]Unhandled Exception: MissingPluginException(No implementation found for method xxx on channel xxx) 2 2022-02-22 2022-11-16
Support VxWorks "muncher" for C++ 4 2021-01-28 2022-10-25
rustup's libgcc_s_dw2-1.dll breaks gcc under i686-pc-windows-gnu 7 2022-07-20 2022-11-24
Enum emit: reverse for minification 6 2017-11-08 2022-10-18
incorrect diagram 1 2016-09-07 2021-10-29
[sqlserver]: connection string with instance name 1 2022-01-20 2022-08-30
chore: support new golang version go1.19.2 1 2022-10-04 2022-10-10
[META 123123131] test 0 2021-08-14 2022-10-24
React Native | Android Studio 5 2021-08-19 2022-11-27
Document M1/ARM64 tooling story 0 2021-09-11 2022-10-15