You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fsevents@~2.3.3 is an optional dependency for vite, and vite can run fine without it.
However, if some other package adds fsevents@1, vite breaks:
file:///Users/cornholio/dev/tmp/vite-bug/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:43399
const stop = fsevents.watch(path, callback);
^
TypeError: fsevents.watch is not a function
at createFSEventsInstance (file:///Users/cornholio/dev/tmp/vite-bug/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:43399:25)
at setFSEventsListener (file:///Users/cornholio/dev/tmp/vite-bug/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:43455:16)
at FsEventsHandler._watchWithFsEvents (file:///Users/cornholio/dev/tmp/vite-bug/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:43659:18)
at FsEventsHandler.initWatch (file:///Users/cornholio/dev/tmp/vite-bug/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:43735:23)
at FsEventsHandler._addToFsEvents (file:///Users/cornholio/dev/tmp/vite-bug/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:43824:12)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js v22.6.0
Reproduction
probably not reproducible on linux, as fsevents is a mac package
Steps to reproduce
npm init
# remixd depends on [email protected], which depends on fsevents@^1.2.7
npm install --save vite @remix-project/remixd
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Ideally, yes.
It can be solved on package manager level, and I think yarn's PnP shouldn't be susceptible, for example.
I wouldn't get my hopes up about npm fixing it though anytime soon. It's just the way node_modules work, and I think a lot of code in the industry actually expects it to work like that.
UPD: wait a second... I was under impression that vite's using fsevents directly (as it lists fsevents in its optionalDependencies), but it looks like it uses fsevents via chokidar instead? Probably should be directed to chokidar then..
I even found an (unfortunately closed) issue there paulmillr/chokidar#1180
Describe the bug
fsevents@~2.3.3
is an optional dependency for vite, and vite can run fine without it.However, if some other package adds
fsevents@1
, vite breaks:Reproduction
probably not reproducible on linux, as fsevents is a mac package
Steps to reproduce
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: