-
-
Notifications
You must be signed in to change notification settings - Fork 569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Cannot find module 'fsevents' #828
Comments
fsevents is only installed for macos. It is not installed on Linux. You should not be seeing this error "Cannot find module 'fsevents' from" at all. So, kinda strange. Solution: Ensure you are using chokidar v3 and higher! Chokidar v2 uses fsevents v1, which is deprecated. Note: you will need to use node.js v8.10 or higher for chokidar v3. |
You can delete your node_modules folder and yarn.lock file and run yarn install again this works for me |
I am getting same error on Windows |
I'm getting the same error on Manjaro with chokidar v3.4.0 |
I am getting the same error on Windows for chokidar version 2.0 |
look in top file, can be import same this "const { ContextReplacementPlugin } = require("webpack");" |
I'm having the same problem with Chokidar v3.5.1 on Kubuntu 20.04 LTS |
I have an Electron App (writtten in VUE). that uses chokidar to watch file system events. complile just started to fail with: Module not found: Error: Can't resolve 'fsevents' in 'C:\Code\sidekick\node_modules\chokidar\lib' the app actually compiles despite this error, but upon running, I get a webpack error: Uncaught TypeError: The "original" argument must be of type Function This setup was working fine until just recently. Not really sure where to go from here. thanks, -Mike additional info. i'm on a windows 10 machine, so fsevents shouldn't even be called, right? |
So how to fix it? I have it with version 3.5.1. |
I was getting this error during JS debugging sessions; turns out I had left my "break on caught exceptions" box checked. Maybe that's helpful to someone. |
Tried above solutions still getting this error. I'm on Windows 10 too. The package for me causing this is 'electron-reloader' |
I was able to solve (workaround) this issue by mocking the
module.exports = undefined In resolve: {
alias: {
fsevents$: path.resolve(__dirname, `fsevents.js`),
},
}, I explain this in detail on Stack Overflow |
I've found a workaround inspired by @totymedli which does not break If you're using Webpack, simply add the following to your if (process.platform !== "darwin") {
context.plugins.push(
new webpack.IgnorePlugin({
resourceRegExp: /^fsevents$/,
})
);
} |
That is indeed a better solution however I would write it like this: const { IgnorePlugin } = require('webpack');
const optionalPlugins = [];
if (process.platform !== "darwin") {
optionalPlugins.push(new IgnorePlugin({ resourceRegExp: /^fsevents$/ }));
}
module.exports = {
// other webpack config options here...
plugins: [
...optionalPlugins,
],
}; |
This solved my problem, I was using VSCode and i dont know somehow, my checkbox for "Caught Exception" was marked. |
Thanks @hassanrazase |
Module not found: Error: Can't resolve 'fsevents' in '/node_modules/chokidar/lib' Uncaught TypeError: The "original" argument must be of type Function
I`m in Linux Centos7, and I have exactly the same error? Please help |
Ran into a similar issue on ubuntu (22.04, if that matters at all ). The solution by @totymedli - helped fix the issue. |
Are there any updates to this error on Windows?
Please help me with the following error: I have tried the following options:
|
Describe the bug
When precompile assets :
Versions (please complete the following information):
During Yarn Install
Use
My application is a Rails App 5.2 and I use gem "browserify-rails".
Chokidar is a dependency of "watchpack".
"watchpack" is a dependency of "webpack".
Question
Why "fsevents" optionalDependency fail when compile assets?
Thanks,
The text was updated successfully, but these errors were encountered: