Netlify CLI crashed unexpectedly while computer was locked

未关闭
#8,615 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
nodejs, typescript
领域
cli

调研方向

The crash comes from chokidar's watch setup, shown in the stack trace at createFsWatchInstance and _handleFile, reached while netlify dev watches public/images/Rampensau_1.heic on Windows. Start by finding where the dev command creates its file watcher and where the watcher's error events are handled. Reproducing it needs a locked file on Windows, so a unit test that makes the watcher emit EBUSY is probably the practical route. Done means a locked file logs a warning and the dev server keeps running.

由索引模型根据 Issue 内容生成。

描述

type: bug
Describe the bug

Netlify CLI crashed unexpectedly. It produced the following error message and advised me to post it here

Error: EBUSY: resource busy or locked, watch 'C:\Users\lorin\Documents\Github\jolomagic\public\images\Rampensau_1.heic'
at FSWatcher. (node:internal/fs/watchers:323:19)
at Object.watch (node:fs:2608:36)
at createFsWatchInstance (C:\Users\lorin\AppData\Roaming\npm\node_modules\netlify-cli\node_modules\chokidar\lib\nodefs-handler.js:119:15)
at setFsWatchListener (C:\Users\lorin\AppData\Roaming\npm\node_modules\netlify-cli\node_modules\chokidar\lib\nodefs-handler.js:166:15)
at NodeFsHandler._watchWithNodeFs (C:\Users\lorin\AppData\Roaming\npm\node_modules\netlify-cli\node_modules\chokidar\lib\nodefs-handler.js:331:14)
at NodeFsHandler._handleFile (C:\Users\lorin\AppData\Roaming\npm\node_modules\netlify-cli\node_modules\chokidar\lib\nodefs-handler.js:395:23)
at NodeFsHandler._addToNodeFs (C:\Users\lorin\AppData\Roaming\npm\node_modules\netlify-cli\node_modules\chokidar\lib\nodefs-handler.js:637:21)

System:
OS: Windows 11 10.0.26300
CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
Binaries:
Node: 24.21.0 - C:\Program Files\nodejs\node.EXE
npm: 11.19.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Chromium (152.0.4191.53)

Steps to reproduce
  1. run netlify dev
  2. use it
  3. let it sit for a while (laptop was locked in the meantime)
  4. open vs code again
  5. see that CLI exited with an error
Configuration

[build]
functions = "/scripts/server"
command = "node scripts/build/version.js && node scripts/build/indexImages.js && node scripts/build/referencesImages.js && node scripts/build/injected.js"

Environment

System:
OS: Windows 11 10.0.26300
CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
Memory: 1.25 GB / 15.80 GB
Binaries:
Node: 24.21.0 - C:\Program Files\nodejs\node.EXE
npm: 11.19.0 - C:\Program Files\nodejs\npm.CMD

主要语言
TypeScript
星标
1.9k
派生
482
平均合并
2 天 3 小时
30 天内合并 PR
98

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

netlify/cli 的其他 Issue

查看 netlify/cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。