Closed ellyxc closed 1 year ago
Using i18next-icu in browser will result ReferenceError: module is not defined error.
ReferenceError: module is not defined
Install i18next and i18next-icu and load in html file like below
npm install i18next i18next-icu
in the html file
<html> <head> <script src="node_modules/i18next/i18next.min.js"></script> <script src="node_modules/i18next-icu/i18nextICU.js"></script> </head> <body> <script> i18next .use(i18nextICU) .init({ lng: "en", resources: { en: { translation: { key: "You have {numPhotos, plural, " + "=0 {no photos.}" + "=1 {one photo.}" + "other {# photos.}}" } } } }); i18next.t("key", { numPhotos: 1000 }) </script> </body> </html>
Javascript above run successfully, instead of returning Uncaught ReferenceError: module is not defined error.
Uncaught ReferenceError: module is not defined
Can you try with v2.1.0 ?
i just tried and no error anymore. Thank you.
š Bug Report
Using i18next-icu in browser will result
ReferenceError: module is not defined
error.To Reproduce
Install i18next and i18next-icu and load in html file like below
in the html file
Expected behavior
Javascript above run successfully, instead of returning
Uncaught ReferenceError: module is not defined
error.Environment