Angular 9 introduced a global '$localize()' function that needs to be loaded

Balaganesan Ravichandran picture Balaganesan Ravichandran · Sep 16, 2019 · Viewed 26.5k times · Source

I'm getting the following error in my new angular project setup.

Installed Packages and its versions

ERROR Error: Uncaught (in promise): Error: It looks like your application or one of its dependencies is using i18n. Angular 9 introduced a global $localize() function that needs to be loaded. Please add import '@angular/localize'; to your polyfills.ts file. Error: It looks like your application or one of its dependencies is using i18n. Angular 9 introduced a global $localize() function that needs to be loaded.

Note: I came from the following. It suggests falling back to old version. https://github.com/angular/angular/issues/32508

Answer

rhino5oh picture rhino5oh · Sep 17, 2019

You need to make sure you have the @angular/localize package first:

npm install @angular/localize --save

Then, import '@angular/localize/init' in your polyfills.ts file just like the error says