question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make "Angular 9 introduced a global `$localize()`..." message a warning instead of error

See original GitHub issue

πŸš€ feature request

Relevant Package

This feature request is for @angular/core

Description

Please consider changing the β€œAngular 9 introduced a global`$localize()…” message from an error to a console warning. In a monorepo, a shared lib/module may have components that are i18n aware that some applications will actually not use, although they have a dependency for some other functionality. With this message as an error, even applications that don’t require i18n now break at runtime.

Describe the solution you’d like

Use console.warn(…) instead.

Describe alternatives you’ve considered

Not much I can do except add import '@angular/localize/init'; to all apps in the monorepo. Other suggestions welcome.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jimbarrett33commented, Sep 8, 2020

@petebacondarwin thanks. I’ll put this on my radar to test. I have a busy couple weeks coming up.

1reaction
petebacondarwincommented, Aug 17, 2020

https://github.com/angular/angular/pull/38404 should solve this problem (by moving the $localize calls into a lazy evaluated factory function. In this case the call is not made if the component is not used.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 9 introduced a global '$localize()' function that needs ...
@angular/localize is a dependency in my package.json, and the @angular/localize/init is an import in my polyfills.ts, but same error on mostΒ ...
Read more >
Angular 9 introduced a global `$localize()` function that needs ...
Angular 9 introduced a global `$localize()` function that needs to be loaded, Uncaught Error: It looks like your application or one of itsΒ ......
Read more >
Internationalization with @angular/localize | Ninja Squad
Error : It looks like your application or one of its dependencies is using i18n. Angular 9 introduced a global `$localize()` function thatΒ ......
Read more >
$localize Global Import Migration - Angular
@angular/localize is a new package that supports i18n of messages in Ivy applications. This package requires a global $localize symbol to exist.
Read more >
The Ultimate Guide to Angular Localization | Phrase
Now that we've installed and configured the @angular/localize package, let's run through an example of how we would localize a string of text...
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