You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm just integrating this library in a personal project and it works fine, except when I want to use message interpolation.
Describe the bug
An error is shown in the console when trying to use interpolation. intl_messageformat__WEBPACK_IMPORTED_MODULE_3__ is not a constructor
Expected behavior
The text should be correctly shown.
Information about your project:
Mac Catalina
svelte-i18n 2.2.1
webpack
Additional context
The error seems totally related with the configuration of this package with webpack, so, here you have my webpack config file.
Changed i18n.mjs to i18n.esm.js to prevent webpack to only accept .mjs
imports inside the library. Webpack was importing the cjs version of
Intl-Formatmessage and messing things up.
Issues: #36
Boy, that was a fun hard one. I was exporting the esm version of the library as a .mjs file instead of something like .esm.js. What I didn't know was that webpack would refuse to resolve any of the library's dependency as an esm module if they weren't a .mjs file as well. So it was actually mixing esm and cjs modules and messing everything up.
Just renamed i18n.mjs to i18n.esm.js 🤷♂. Should be fixed on v2.2.2 🎉
Hi guys, congrats for the library.
I'm just integrating this library in a personal project and it works fine, except when I want to use message interpolation.
Describe the bug
An error is shown in the console when trying to use interpolation.
intl_messageformat__WEBPACK_IMPORTED_MODULE_3__ is not a constructor
Expected behavior
The text should be correctly shown.
Information about your project:
svelte-i18n
2.2.1Additional context
The error seems totally related with the configuration of this package with webpack, so, here you have my webpack config file.
Hope you can help me.
Thanks!
The text was updated successfully, but these errors were encountered: