Error: Missing locale data for the locale "fr".

See original GitHub issue

Bug Report or Feature Request (mark with an x)

- [ X ] bug report
- [ ] feature request

Saw issue #6683 but it does not solve my problem

Versions.

Angular CLI: 1.5.0 Node: 6.11.5 OS: linux x64 Angular: 5.0.1 … animations, common, compiler, compiler-cli, core, forms … http, language-service, platform-browser … platform-browser-dynamic, router

@angular/cli: 1.5.0 @angular/platform-server: 4.3.6 @angular-devkit/build-optimizer: 0.0.32 @angular-devkit/core: 0.0.20 @angular-devkit/schematics: 0.0.35 @ngtools/json-schema: 1.1.0 @ngtools/webpack: 1.8.0 @schematics/angular: 0.1.0 typescript: 2.4.2 webpack: 3.8.1

Repro steps.

I upgraded from Angular 4 to 5 and got this error in the browser when using the local FR. But it works perfectly with EN!

The log given by the failure.

ERROR Error: Missing locale data for the locale “fr”. Stack trace: findLocaleData@webpack-internal:///…/…/…/common/esm5/common.js:1561:11 getLocaleNumberFormat@webpack-internal:///…/…/…/common/esm5/common.js:1404:33 formatNumber$1@webpack-internal:///…/…/…/common/esm5/common.js:4999:35 DecimalPipe.prototype.transform@webpack-internal:///…/…/…/common/esm5/common.js:6106:18 checkAndUpdatePureExpressionInline@webpack-internal:///…/…/…/core/esm5/core.js:13095:33 checkAndUpdateNodeInline@webpack-internal:///…/…/…/core/esm5/core.js:13798:20 checkAndUpdateNode@webpack-internal:///…/…/…/core/esm5/core.js:13737:16 debugCheckAndUpdateNode@webpack-internal:///…/…/…/core/esm5/core.js:14609:55 debugCheckRenderNodeFn@webpack-internal:///…/…/…/core/esm5/core.js:14588:13 View_ChargersComponent_0/<@ng:///ChargersModule/ChargersComponent.ngfactory.js:350:47 debugUpdateRenderer@webpack-internal:///…/…/…/core/esm5/core.js:14573:12 checkAndUpdateView@webpack-internal:///…/…/…/core/esm5/core.js:13709:5 callViewAction@webpack-internal:///…/…/…/core/esm5/core.js:14054:21 execComponentViewsAction@webpack-internal:///…/…/…/core/esm5/core.js:13986:13 checkAndUpdateView@webpack-internal:///…/…/…/core/esm5/core.js:13710:5 callViewAction@webpack-internal:///…/…/…/core/esm5/core.js:14054:21 execEmbeddedViewsAction@webpack-internal:///…/…/…/core/esm5/core.js:14012:17 checkAndUpdateView@webpack-internal:///…/…/…/core/esm5/core.js:13705:5 callViewAction@webpack-internal:///…/…/…/core/esm5/core.js:14054:21 execComponentViewsAction@webpack-internal:///…/…/…/core/esm5/core.js:13986:13 checkAndUpdateView@webpack-internal:///…/…/…/core/esm5/core.js:13710:5 callViewAction@webpack-internal:///…/…/…/core/esm5/core.js:14054:21 execEmbeddedViewsAction@webpack-internal:///…/…/…/core/esm5/core.js:14012:17 checkAndUpdateView@webpack-internal:///…/…/…/core/esm5/core.js:13705:5 callViewAction@webpack-internal:///…/…/…/core/esm5/core.js:14054:21 execComponentViewsAction@webpack-internal:///…/…/…/core/esm5/core.js:13986:13 checkAndUpdateView@webpack-internal:///…/…/…/core/esm5/core.js:13710:5 callWithDebugContext@webpack-internal:///…/…/…/core/esm5/core.js:14936:39 debugCheckAndUpdateView@webpack-internal:///…/…/…/core/esm5/core.js:14473:12 ViewRef_.prototype.detectChanges@webpack-internal:///…/…/…/core/esm5/core.js:11496:9 ApplicationRef.prototype.tick/<@webpack-internal:///…/…/…/core/esm5/core.js:5982:58 ApplicationRef.prototype.tick@webpack-internal:///…/…/…/core/esm5/core.js:5982:13 next/<@webpack-internal:///…/…/…/core/esm5/core.js:5815:99 ZoneDelegate.prototype.invoke@webpack-internal:///…/…/…/…/zone.js/dist/zone.js:392:17 onInvoke@webpack-internal:///…/…/…/core/esm5/core.js:4825:24 ZoneDelegate.prototype.invoke@webpack-internal:///…/…/…/…/zone.js/dist/zone.js:391:17 Zone.prototype.run@webpack-internal:///…/…/…/…/zone.js/dist/zone.js:142:24 NgZone.prototype.run@webpack-internal:///…/…/…/core/esm5/core.js:4642:54 next@webpack-internal:///…/…/…/core/esm5/core.js:5815:69 EventEmitter.prototype.subscribe/schedulerFn<@webpack-internal:///…/…/…/core/esm5/core.js:4419:36 SafeSubscriber.prototype.__tryOrUnsub@webpack-internal:///…/…/…/…/rxjs/_esm5/Subscriber.js:244:13 SafeSubscriber.prototype.next@webpack-internal:///…/…/…/…/rxjs/_esm5/Subscriber.js:191:17 Subscriber.prototype._next@webpack-internal:///…/…/…/…/rxjs/_esm5/Subscriber.js:132:9 Subscriber.prototype.next@webpack-internal:///…/…/…/…/rxjs/_esm5/Subscriber.js:96:13 Subject.prototype.next@webpack-internal:///…/…/…/…/rxjs/_esm5/Subject.js:66:17 EventEmitter.prototype.emit@webpack-internal:///…/…/…/core/esm5/core.js:4399:24 checkStable@webpack-internal:///…/…/…/core/esm5/core.js:4790:13 onHasTask@webpack-internal:///…/…/…/core/esm5/core.js:4838:21 ZoneDelegate.prototype.hasTask@webpack-internal:///…/…/…/…/zone.js/dist/zone.js:445:21 ZoneDelegate.prototype._updateTaskCount@webpack-internal:///…/…/…/…/zone.js/dist/zone.js:465:17 Zone.prototype._updateTaskCount@webpack-internal:///…/…/…/…/zone.js/dist/zone.js:289:17 Zone.prototype.runTask@webpack-internal:///…/…/…/…/zone.js/dist/zone.js:209:25 drainMicroTaskQueue@webpack-internal:///…/…/…/…/zone.js/dist/zone.js:602:25 ZoneTask.invokeTask@webpack-internal:///…/…/…/…/zone.js/dist/zone.js:503:21 invokeTask@webpack-internal:///…/…/…/…/zone.js/dist/zone.js:1540:9 globalZoneAwareCallback@webpack-internal:///…/…/…/…/zone.js/dist/zone.js:1566:17

Desired functionality.

That the formatting works with local other than EN

Mention any other details that might be useful.

I’m using @ngx-translate/core for the translation service

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
hmagrinicommented, Jan 10, 2018

From the docs: https://angular.io/guide/i18n#i18n-pipes

The CLI imports the locale data for you when you use the parameter --locale with ng serve and ng build.

@clydin Does this also apply for platform: server and/or lazy-loaded routes? Cause I’m seeing the same errors when pre-rendering an Angular 5 application (following the config guide for Universal from the cli wiki).

I’m building the Browser version like this:

  • ng build --target=production --environment=dev --progress=true --app=eu-browser --i18nFile=src/app-eu/i18n/messages.de.xlf --i18nFormat=xlf --locale=de

And then building the Server version like this:

  • ng build --target=production --environment=dev --progress=true --app=eu-server --i18nFile=src/app-eu/i18n/messages.de.xlf --i18nFormat=xlf --locale=de --output-hashing=false

And yet I still see similar errors when running my pre-render task.

ERROR Error: Missing locale data for the locale “de”. at findLocaleData ($PROJECT$/dist/server.js:24837:11) at getLocaleId ($PROJECT$/dist/server.js:24446:12) at getNamedFormat ($PROJECT$/dist/server.js:27036:37) at formatDate ($PROJECT$/dist/server.js:26997:40) at DatePipe.transform ($PROJECT$/dist/server.js:27789:16) at checkAndUpdatePureExpressionInline ($PROJECT$/dist/server.js:13772:38) at checkAndUpdateNodeInline ($PROJECT$/dist/server.js:14488:20) at checkAndUpdateNode ($PROJECT$/dist/server.js:14427:16) at prodCheckAndUpdateNode ($PROJECT$/dist/server.js:15151:5) at Object.updateRenderer ($PROJECT$/dist/server.js:135484:199660) at Object.updateRenderer ($PROJECT$/dist/server.js:14877:29) at checkAndUpdateView ($PROJECT$/dist/server.js:14398:14) at callViewAction ($PROJECT$/dist/server.js:14744:21) at execEmbeddedViewsAction ($PROJECT$/dist/server.js:14702:17) at checkAndUpdateView ($PROJECT$/dist/server.js:14394:5) at callViewAction ($PROJECT$/dist/server.js:14744:21) at execEmbeddedViewsAction ($PROJECT$/dist/server.js:14702:17) at checkAndUpdateView ($PROJECT$/dist/server.js:14394:5) at callViewAction ($PROJECT$/dist/server.js:14744:21) at execEmbeddedViewsAction ($PROJECT$/dist/server.js:14702:17) at checkAndUpdateView ($PROJECT$/dist/server.js:14394:5) at callViewAction ($PROJECT$/dist/server.js:14744:21)

4reactions
lordjesuscommented, Nov 11, 2017

I had the same issue for “da-DK”. I found the solution here: https://github.com/angular/angular/issues/20286

Direct link to docs: https://angular.io/guide/i18n#i18n-pipes

Read more comments on GitHub >

github_iconTop Results From Across the Web

Missing locale data for the locale "XXX" with angular
In file app.module.ts ... import { NgModule, LOCALE_ID } from '@angular/core'; import { registerLocaleData } from '@angular/common'; ...
Read more >
DatePipe: Missing locale data for the locale "de" · Issue #20286
When I use DatePipe in my component it throws an error: Missing locale data for the locale "de". new DatePipe('de').transform(.
Read more >
Dynamic Import of Locales in Angular | by Michael Karén
If you have some code right after the import that updates the values that use you might get this error: Missing locale data...
Read more >
LOCALE_ID - Angular
Provide this token to set the locale of your application. It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe, ...
Read more >
NSX-T: Missing locale data for the locale "XX".
When I copies the error to the clipboard, it would give the same error as in the first screen, namely: Missing locale data...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found