I have problem in i18n

I go through some i18n tutorial but I got error.

This is the error I got

ERROR in ./src/locales/en-GB_translation.json (./node_modules/bundle-loader?lazy&name=lang-en-GB!./src/locales/en-GB_translation.json)
Module parse failed: Unexpected token m in JSON at position 0 while parsing near ‘module.exports = fun…’
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token m in JSON at position 0 while parsing near ‘module.exports = fun…’

I’m using webpack for this project.

please help me to sort out this issue.

Can you add (part of) the translation file? I suspect a syntax error in the JSON file. You may try to validate your file via https://jsonlint.com/ (or similar tool).

1 Like

Could you try this within your webpack config?

{ test: /.json$/i, loader: ‘json-loader’, type: ‘javascript/auto’ },

2 Likes

I’m able to fixed this @mroseboom thnx for help I added your code and install json loader then work for me.