I am using next.js
and I get:
Failed to compile.
./node_modules/fsevents/fsevents.node 1:0
Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
I tried almost everything, most recently, to package.json
, I added:
"optionalDependencies": {
"fsevents": "^2.1.3"
}
In next.config.js
, I have:
const withImages = require("next-images");
const withPlugins = require("next-compose-plugins");
const withCSS = require("@zeit/next-css");
module.exports = withPlugins([
withCSS,
withImages,
]
Not sure what else to do.
I fixed it in my VS Code extension by adding:
{
test: /.node$/,
loader: 'node-loader',
}
to the module.rules
in webpack.config.js
and adding:
"node-loader": "^1.0.1",
to the devDependencies
in package.json
Try check what encoding used in fsevents.node I was getting similar exception. Problem was in UTF-16 encoding of file. Changed to UTF-8 and it did help.
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