-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Development with ng serve gets "stuck" with $localize error when using i18n attributes and localize option set to sourceLocale #22435
Comments
I am facing the same issue after updating Angular from V11 to the latest V13. |
Trying the obvious to disable the cache as per the documentation does not fix the issue https://angular.io/cli/cache#enabling-and-disabling-the-cache |
I wasn't able to reproduce the issue using the provided steps
Can you setup a minimal repro please? You can read here why this is needed. A good way to make a minimal repro is to create a new app via This might be related to your directory structure so its really important to get an accurate repro to diagnose this. |
This is the newly created app I used for my step by step descripton: https://gist.github.com/reifi/a7528447fb5aca26b34097d2ef03f46f#file-screenshot-2022-01-10-135502-png |
…aced in watch mode When `translations` is undefined `$localize` calls are not replaced. https://github.com/angular/angular-cli/blob/2c9a33dddb38694b6940ec6981c49904de1ab636/packages/angular_devkit/build_angular/src/builders/dev-server/index.ts#L382 Closes #22435
…aced in watch mode When `translations` is undefined `$localize` calls are not replaced. https://github.com/angular/angular-cli/blob/2c9a33dddb38694b6940ec6981c49904de1ab636/packages/angular_devkit/build_angular/src/builders/dev-server/index.ts#L382 Closes #22435 (cherry picked from commit 426ddb6)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Which @angular/* package(s) are the source of the bug?
localize, Don't known / other
Is this a regression?
Yes
Description
Calling ng serve with a configuration that uses the "localize" option set to the sourceLocale (mine is 'de-AT'),
for example
ng serve --browserTarget=my-app:build:development,locale-de-at
will lead to a false $localize error message and forces you to delete .angular cache and restart ng serve.
Worked in v13.0.3 but will only show incorrect error message during development in v13.1.0+
Please provide a link to a minimal reproduction of the bug
https://gist.github.com/reifi/a7528447fb5aca26b34097d2ef03f46f
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
After updating to from angular v13.0.3 to v13.1.1 the $localize error appeared every time I accidentally made a mistake during development with ng serve and did not go away until I deleted the .angular directory and restarted ng serve.
I was able to reproduce it with a newly generated app I updated to v13.1.1.
https://gist.github.com/reifi/a7528447fb5aca26b34097d2ef03f46f
ng serve --browserTarget=my-app:build:development,locale-de-at
Using
ng serve --browserTarget=my-app:build:development,locale-it
(using localize 'it') works, probably because it's not the sourceLocale.Workaround:
Using
ng serve --browserTarget=my-app:build:development,locale-de-at
(using localize 'de-AT') does not work, but omitting the 'localize' option likeng serve --browserTarget=my-app:build:development
does - although probably ignoring additional configuration like baseHref in i18n.Found differences in cache
The cached content in .angular/cache/babel-dev-server-i18n/ will change from (for example)
to
which leads to the error because "$localize" is not needed during runtime
The text was updated successfully, but these errors were encountered: