Vite.js v2 occasionally crashes during development on Windows 10
See original GitHub issue⚠️ IMPORTANT ⚠️ Please check the following list before proceeding. If you ignore this issue template, your issue will be directly closed.
- Read the docs.
- Use Vite >=2.0. (1.x is no longer supported)
- If the issue is related to 1.x -> 2.0 upgrade, read the Migration Guide first.
Describe the bug
A clear and concise description of what the bug is.
My react project is created by yarn create @vitejs/app <repo-name> --template react-ts
.
When I start vite command yarn dev
and save files it shows this error and stops vite runtime (it crashes sometimes sooner sometimes later):
15:53:57 [vite] hmr update /src/App.tsx
node:events:353
throw er; // Unhandled 'error' event
^
Error: EBUSY: resource busy or locked, lstat 'C:\DumpStack.log.tmp'
Emitted 'error' event on FSWatcher instance at:
at FSWatcher._handleError (C:\Users\bransky\projects\_playground\vitejs-issue-watcher-reproduction\node_modules\vite\dist\node\chunks\dep-055fc131.js:11574:10)
at ReaddirpStream.NodeFsHandler._boundHandleError (C:\Users\bransky\projects\_playground\vitejs-issue-watcher-reproduction\node_modules\vite\dist\node\chunks\dep-055fc131.js:10070:43)
at ReaddirpStream.emit (node:events:376:20)
at emitErrorNT (node:internal/streams/destroy:188:8)
at emitErrorCloseNT (node:internal/streams/destroy:153:3)
at processTicksAndRejections (node:internal/process/task_queues:80:21) {
errno: -4082,
code: 'EBUSY',
syscall: 'lstat',
path: 'C:\\DumpStack.log.tmp'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Reproduction
Please provide a link to a repo that can reproduce the problem you ran into. A reproduction is required unless you are absolutely sure that the the problem is obvious and the information you provided is enough for us to understand what the problem is. If a report has only vague description (e.g. just a generic error message) and has no reproduction, it will be closed immediately.
https://github.com/MatejBransky/vitejs-issue-watcher-reproduction
(it’s the unchanged project right after the command yarn create @vitejs/app <repo> --template react-ts
)
I think it’s related to some background services which run e.g. during VS Code session because if I try to reproduce it within external terminal and project is not opened in VS Code then it’s still working…but when I try to open project with VS Code then sometimes(!) it crashes.
VS Code version: 1.52.1
System Info
vite
version: 2.0.0-beta.48 (I had the issue already in v 2.0.0-beta.12)- Operating System: Windows 10 Pro (19042.746)
- Node version: 15.4.0
- Package manager (
npm/yarn/pnpm) and version: yarn v1.22.5
Logs (Optional if provided reproduction)
- Run
vite
orvite build
with the--debug
flag. - Provide the error log here.
16:41:27 [vite] hmr update /src/App.css (x2)
vite:load 1ms [fs] /src/App.css +2s
vite:hmr [self-accepts] src\App.css +7ms
vite:transform 0ms /src/App.css +2s
vite:time 3ms /src/App.css?import& +2s
vite:load 3ms [fs] /src/App.css +2ms
vite:hmr [self-accepts] src\App.css +2ms
vite:transform 1ms /src/App.css +2ms
vite:time 4ms /src/App.css?import& +2ms
node:events:353
throw er; // Unhandled 'error' event
^
Error: EBUSY: resource busy or locked, lstat 'C:\DumpStack.log.tmp'
Emitted 'error' event on FSWatcher instance at:
at FSWatcher._handleError (C:\Users\bransky\projects\_playground\vitejs-issue-watcher-reproduction\node_modules\vit
e\dist\node\chunks\dep-382a279c.js:11575:10)
at ReaddirpStream.NodeFsHandler._boundHandleError (C:\Users\bransky\projects\_playground\vitejs-issue-watcher-repro
duction\node_modules\vite\dist\node\chunks\dep-382a279c.js:10071:43)
at ReaddirpStream.emit (node:events:376:20)
at emitErrorNT (node:internal/streams/destroy:188:8)
at emitErrorCloseNT (node:internal/streams/destroy:153:3)
at processTicksAndRejections (node:internal/process/task_queues:80:21) {
errno: -4082,
code: 'EBUSY',
syscall: 'lstat',
path: 'C:\\DumpStack.log.tmp'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
(I started yarn dev --debug
at cca 16:35, last change was done at 16:41:27 and it crashed at 16:42:10 so it’s not related to the last change in the source code)
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Good to know the blind guess fix worked! 😅
I saw that error a lot while working on a Vite app last week. But it was really random.
After reading Evan’s comment, I found a reproduction.
Simply creating a new folder on
C:\
directory fires this error.I can reproduce in v2.0.0-beta.48. v2.0.0-beta.49 works fine ✌