Hii I am working with language translation using "react-intl": "^4.1.1",
but when I creating production build then code is not compiled and shows the error about default export
Error :
Creating an optimized production build...
Failed to compile.
./src/lang/entries/es_ES.js
Attempted import error: '../locales/es_ES' does not contain a default export (imported as 'enMessages').
I am importing file like this:
import enMessages from '../locales/en_US';
Exporting :
export default {
"sidebar.dashboard" : "Dashboard"
}
The most important thing is its working on the local and generating issues while creating a production build and I am using "react-scripts": "^3.3.0"
in this project. How can I solve this?
Update: After import enMessages
import endata from '@formatjs/intl-pluralrules/dist/locale-data/en';
import enMessages from '../locales/en_US';
const EnLang = {
messages: {
...enMessages
},
locale: 'en-US',
data: endata
};
export default EnLang;