Archimede
Archimede

Reputation: 727

i18n Angular, error by creating translation files

In my app all works correctly and I can execute each component or function without any error, so in terminal, as in the developer console of the browser. I tried to install the i18n internationalization by the following command:

ng xi18n --output-path src/locale

The file creates itself correctly but I see this strange error.

Cannot assign to read only property '_showWarnings' of object '#<Object>'
TypeError: Cannot assign to read only property '_showWarnings' of object '#<Object>'
    at TapSubscriber._visitJsonRecursive.pipe.operators_1.tap.x [as _tapNext] (C:\Users\myname\Documents\Projekt\myProjekt\node_modules\@angular-devkit\core\src\json\schema\visitor.js:56:210)

Why? How can I fix it?

Upvotes: 1

Views: 1039

Answers (1)

sevic
sevic

Reputation: 972

This also happened to me. after I upgraded the packet angular-devkit/build-angular. On version 0.803.2 it worked totally fine. Since npm audit warned me about vulnerabilities I updated this packet to version 0.803.23. This lead to exactly the error you are describing.

I did not find a proper solution yet, but for now the following workaround does the job:

Remove your node_modules folder, downgrade the packet, run npm install, run ng xi18n --output-path src/locale and drop the changes on npm-shrinkwrap.json and package.json again.

Edit

Updating all the @angular related packages to the latest 8.x version solved the problem for me.

Upvotes: 1

Related Questions