-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
fix: add ref() and unref() to chokidar.d.ts for typescript build to work. #15706
Conversation
… successfully build.
Run & review this pull request in StackBlitz Codeflow. |
There are some details in:
Probably this happens for users who upgraded to |
Thanks for investigating this @hi-ogawa! Let's wait a bit to see what they decide to do in: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure when chokidar will be able to resolve the issue, but I think anyways chokidar will have to do the same fix here as ref/unref had long existed in node12/14, so leaving my approval here for now.
Ok, let's merge this then 👍🏼 |
Seeing as the problematic node type update has broken every version of vite that runs with up-to-date node type definitions, is there any chance of this fix getting backported to the 4.x branch? I can't be the only one with multiple build jobs that are still running things in that range. |
Description
When attempting to build a vite project after updating from 5.0.8 to 5.0.12, received following error:
ERROR(TypeScript) Class 'import("D:/Projects/PROJECT/node_modules/vite/dist/node/index").FSWatcher' incorrectly implements interface 'import("fs").FSWatcher'.
Type 'FSWatcher' is missing the following properties from type 'FSWatcher': ref, unref
FILE D:/Projects/PROJECT/node_modules/vite/dist/node/index.d.ts:68:15
Additional context
Not 100% certain if this is the perfect fix, but adding the same two methods to vite/dist/node/index.d.ts allowed build to complete successfully. (Sorry, First time contributing, have read guidelines but nearly certainly have missed something!)
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).