Using vue-i18n.runtime.esm-bundler.js in Webpack vue.config.js alias to stop a CSP error causes "Unexpected return type in composer" #392
Labels
Status: Review Needed
Request for review comments
Reporting a bug?
We spent the day trying to track down a CSP bug:
In looking through previous GitHub issues I've realised we need to reference the esm-bundler in
vue.config.js
:Because the non bundler version calls
new Function(...
which throws a CSP errorAdding the alias in vue.config.js to
vue-i18n/dist/vue-i18n.runtime.esm-bundler.js
now stops the CSP bug occurring but throws a new error:Locales are in json format:
So now we're stuck with, not use the alias, or use it and it breaks.
Expected behavior
JSON translations and i18n esm prod bundler should initialise correctly.
Reproduction
i18n.ts is like so:
Similar to this issue I feel like I'm on the same journey with a no resolution though:
intlify/vue-i18n#381
Issue Package
vue-i18n-loader
System Info
Screenshot
No response
Additional context
I had to add:
In order to stop the non runtime version creating
new Function(
and causing the error:Here is my vue.config.js file:
Validations
The text was updated successfully, but these errors were encountered: