-
-
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
type error | Type 'FSWatcher' is missing the following properties from type 'FSWatcher': ref, unref #15714
type error | Type 'FSWatcher' is missing the following properties from type 'FSWatcher': ref, unref #15714
Comments
adding these line will be solved the problem: // node_modules/vite/dist/node/index.d.ts
declare class FSWatcher extends EventEmitter implements fs.FSWatcher {
options: WatchOptions
ref(): this; // <-- added
unref(): this; // <-- added |
See also: DefinitelyTyped/DefinitelyTyped#68300 for @types/node@20.11.6 |
it's being under investigation and discussion in PR #15706 |
The same happens with vite 4.5.2 suddenly |
tsconfig.json add "skipLibCheck": true |
Signed-off-by: Roman Ondráček <mail@romanondracek.cz> Upstream-Issue: vitejs/vite#15714
I'm also having this issue, I cannot build my project due to it. |
"@types/node": "^18.19.9", |
Didn't helped |
) Added github actions to run test, lint, build on PR for main branch > NOTE: temporarily skip build step during ci - there is an upstream bug that is still being investigated - vitejs/vite#15714
The same |
This is already fixed in #15706 and released in 5.1 beta |
and what about 4.5.2? |
It seems weird to close the issue when the latest non-beta version still doesn't work out of the box. Closed issues have less visibility, too, so this is bound to be a problem for beginners starting a new vite/ts project. Is there a timeline for 5.1 already or something like "this week" / "this month"? I found the release cycle page but I don't know which case applies here. |
We're releasing 5.1 stable today (if all goes well. worst case is next Monday). There aren't any plans to backport the fixes to v4 yet. |
Thank you for fixing this in the latest version!
As someone who cannot update to Vite 5 I still hope this fix will be backported to Vite 4 as well. The major reasons for sticking to Vite 4 is that a library I'm writing still supports Node 16 (next breaking will drop support though) and for compatibility I still support Vite 4 and want to run tests against Vite 4 (which is tricky due to this issue). As long as this issue is still present in Vite 4 the message I read is essentially that Vite 4 is dead and only the latest greatest is maintained properly. |
Actually got introduced with Node 18.19.0. Latest 18.8.x works (ie: |
Describe the bug
clone repo and npm install && npm run ci
current status:
https://github.com/mhf-ir/Node.js-TypeScript-Starter/actions/runs/7658137582/job/20870418679
Error: node_modules/vite/dist/node/index.d.ts(68,15): error TS2420: Class 'import("/home/runner/work/Node.js-TypeScript-Starter/Node.js-TypeScript-Starter/node_modules/vite/dist/node/index", { with: { "resolution-mode": "import" } }).FSWatcher' incorrectly implements interface 'import("fs").FSWatcher'.
Type 'FSWatcher' is missing the following properties from type 'FSWatcher': ref, unref
Error: Process completed with exit code 2.
Reproduction
https://github.com/mhf-ir/Node.js-TypeScript-Starter
Steps to reproduce
npm install && npm run ci
System Info
System: OS: Linux 6.2 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish) CPU: (4) x64 AMD EPYC 7763 64-Core Processor Memory: 14.59 GB / 15.61 GB Container: Yes Shell: 5.1.16 - /bin/bash Binaries: Node: 20.11.0 - /opt/hostedtoolcache/node/20.11.0/x64/bin/node Yarn: 1.22.21 - /usr/local/bin/yarn npm: 10.2.4 - /opt/hostedtoolcache/node/20.11.0/x64/bin/npm pnpm: 8.14.3 - /usr/local/bin/pnpm Managers: Apt: 2.4.11 - /usr/bin/apt Cargo: 1.75.0 - ~/.cargo/bin/cargo Composer: 2.6.6 - /usr/bin/composer Gradle: 8.5 - /usr/bin/gradle Maven: 3.8.8 - /usr/bin/mvn pip3: 22.0.2 - /usr/bin/pip3 RubyGems: 3.3.5 - /usr/bin/gem Utilities: Bazel: 7.0.1 - /usr/local/bin/bazel CMake: 3.28.1 - /usr/local/bin/cmake Make: 4.3 - /usr/bin/make GCC: 11.4.0 - /usr/bin/gcc Git: 2.43.0 - /usr/bin/git Clang: 14.0.0 - /usr/bin/clang Mercurial: 6.1.1 - /usr/bin/hg Subversion: 1.14.1 - /usr/bin/svn Curl: 7.81.0 - /usr/bin/curl Servers: Nginx: 1.18.0 - /usr/sbin/nginx Virtualization: Docker: 24.0.7 - /usr/bin/docker SDKs: Android SDK: API Levels: 31, 32, 33, 33, 33, 34, 34, 34 Build Tools: 31.0.0, 32.0.0, 33.0.0, 33.0.1, 33.0.2, 34.0.0 Android NDK: 25.2.9519653 IDEs: Nano: 6.2 - /usr/bin/nano Vim: 8.2 - /usr/bin/vim Languages: Bash: 5.1.16 - /usr/bin/bash Go: 1.20.13 - /usr/bin/go Java: 11.0.21 - /usr/bin/javac Perl: 5.34.0 - /usr/bin/perl PHP: 8.1.2 - /usr/bin/php Python: 3.10.12 - /usr/bin/python Python3: 3.10.12 - /usr/bin/python3 R: 4.3.2 - /usr/bin/R Ruby: 3.0.2 - /usr/bin/ruby Rust: 1.75.0 - /home/runner/.cargo/bin/rustc Databases: MySQL: 0.22.04.1 - /usr/bin/mysql SQLite: 3.37.2 - /usr/bin/sqlite3 Browsers: Chrome: 120.0.6099.224 Chromium: 120.0.6099.0
Used Package Manager
npm
Logs
Error: node_modules/vite/dist/node/index.d.ts(68,15): error TS2420: Class 'import("/home/runner/work/Node.js-TypeScript-Starter/Node.js-TypeScript-Starter/node_modules/vite/dist/node/index", { with: { "resolution-mode": "import" } }).FSWatcher' incorrectly implements interface 'import("fs").FSWatcher'.
Type 'FSWatcher' is missing the following properties from type 'FSWatcher': ref, unref
Error: Process completed with exit code 2.
Validations
The text was updated successfully, but these errors were encountered: