9

I started my first project in angular with ng-bootstrap and followed the installation procedure, but nevertheless It doesn't work.

The message is "Uncaught 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."

Then I added in polyfill.ts the line

import '@angular/localize';

and now the message changed to

ERROR in ./src/polyfills.ts Module not found: Error: Can't resolve ' @angular/localize' in 'D:\source\mh\Reclamos-v2\src'

What should I install? What is the name of localize library?

2
  • Just a guess, but perhaps you still have a dependency on the i18n library in your package.json left over from a previous Angular version? If so, that probably needs to be removed. Commented Sep 17, 2019 at 2:40
  • Hey Gustavo, did you make it work on Angular 9? Thanks! Commented Jan 2, 2020 at 17:57

3 Answers 3

9

You can try this:

npm install @angular/localize --save
Sign up to request clarification or add additional context in comments.

1 Comment

7

You'll need to both install the package and to import it in polyfills.ts. The easiest way to achieve this is running:

ng add @angular/localize

Comments

0

This issue occurred for me even after removing the package. Removing the import statement from polyfill.ts resolves the issue for me.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.