Closed fauk968 closed 8 months ago
和这个问题https://ask.dcloud.net.cn/question/171946相同,属于框架的一个bug,vite5.0已经修复。
现在的解决方案是,在vite.config.js
中添加以下代码:
defineConfig({
// ...
build: {
watch: {
exclude: ['node_modules/**', "/__uno.css"]
},
}
})
项目运行一段时间后总会自己报错断掉:
开始差量编译... DONE Build complete. Watching for changes... 开始差量编译... DONE Build complete. Watching for changes... node:events:489 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 (file:///C:/Users/%E9%99%88%E5%AD%90%E9%94%9F/Desktop/sleep_cbti_doctor_miniprogram/node_modules/.pnpm/rollup@3.29.4/node_modules/rollup/dist/es/shared/watch.js:4246:10)
at NodeFsHandler._boundHandleError (file:///C:/Users/%E9%99%88%E5%AD%90%E9%94%9F/Desktop/sleep_cbti_doctor_miniprogram/node_modules/.pnpm/rollup@3.29.4/node_modules/rollup/dist/es/shared/watch.js:2720:43) at ReaddirpStream.emit (node:events:511:28) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { errno: -4082, code: 'EBUSY', syscall: 'lstat', path: 'C:\DumpStack.log.tmp' }
Node.js v20.3.1 ELIFECYCLE Command failed with exit code 1.