My project was working perfectly fine.. But after doing a git push, I'm suddenly getting an error when I run gulp
:
{ [Error: ModuleParseError: Module parse failed:
/Users/xyz/project/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json
Line 1: Unexpected token :
You may need an appropriate loader to handle this file type.
| {"uChars":[128,16 ....
Why is this happening? I have uninstalled and reinstalled this module iconv-lite
, but it doesn't seem to help.
I received this same exact error. You'll want to install a JSON loader module. I'm using json-loader in this example.
npm install json-loader --save
Then, you need to add this loader to your webpack.config.js
module: {
loaders: [
{ test: /\.json$/, loader: "json-loader"}
]
}
I had this dependency by an indirect dependency on node-fetch
and fixed the issue by adding the following to my webpack.config.js:
externals: {
'node-fetch': 'fetch'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With