globalizejs / globalize

A JavaScript library for internationalization and localization that leverages the official Unicode CLDR JSON data
https://globalizejs.com
MIT License
4.8k stars 603 forks source link

Webpack error: E_MISSING_MESSAGE_BUNDLE: Missing message bundle for locale `en` #921

Closed mozi22 closed 3 years ago

mozi22 commented 3 years ago

Hi, I am trying to use globalize app-npm-webpack but keep getting the following error.

The goal is to be able to dynamically change the language from a dropdown while using the app. Therefore I performed a small test. From the existing sample app-npm-webpack provided in this repo.

Inside index.js, I try to write the following code.

console.log(Globalize("en").formatMessage("intro-1"));

My understanding is that all the supportedLocales are loaded by the webpack. The selected developmentLocale is de. The defaultLocale is always loaded fine but the app is not changing locale during the running of the app and gives me the error below.

I get the following error.

Screenshot from 2021-07-22 11-17-56

Could anyone point me the reason for this error ?.

I didn't change anything in the app except try to use that line above.

mozi22 commented 3 years ago

Found this, it should be mentioned in the docs.

https://github.com/rxaviers/globalize-webpack-plugin/issues/13