Windows: start fails because daemon path comes from URL.pathname
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 82/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- node.js, typescript
- 領域
- cli
研究方向
從 packages/agent-react-devtools/src/daemon-client.ts 中 daemon 路徑的建構和過期檢查開始,接著檢查 packages/agent-react-devtools/src/daemon.ts 中的 buildMtime 統計資料。查看 CLI 如何根據 import.meta.url 推導路徑,包括 Windows 磁碟機代號和編碼後的空格;issue 指出 fileURLToPath 是預期的轉換方式。完成標準是 daemon 指令碼路徑在 Windows 上有效,且能安裝到包含空格的路徑下。
由索引模型根據 Issue 內容生成。
描述
Summary
On Windows, start always fails with Daemon failed to start within 5 seconds. The CLI builds the daemon script path from new URL(import.meta.url).pathname, which is not a valid file path on Windows.
Environment
- agent-react-devtools 0.5.0 (same code on
main@ d25f34b) - Node 26.8.1
- Windows 11 (10.0.26100)
Repro
> agent-react-devtools start --port 8098
Daemon failed to start within 5 seconds
The spawned daemon exits at once. Running the same spawn by hand shows why:
script: \D:\temp\ard\node_modules\agent-react-devtools\dist\daemon.js
Error: Cannot find module 'D:\D:\temp\ard\node_modules\agent-react-devtools\dist\daemon.js'
Cause
new URL('file:///D:/x/cli.js').pathname is /D:/x/cli.js. After path.join it becomes \D:\x\... (leading backslash), which Node resolves to D:\D:\x\.... pathname also keeps percent-encoding, so an install under a path with spaces breaks on any OS:
url: file:///C:/Program%20Files/nodejs/node_modules/agent-react-devtools/dist/cli.js
pathname: \C:\Program%20Files\nodejs\node_modules\agent-react-devtools\dist\daemon.js
fileURLToPath: C:\Program Files\nodejs\node_modules\agent-react-devtools\dist\daemon.js
Locations:
daemon-client.tsL49 and L82 (daemon script path, stale check)daemon.tsL78 (buildMtimestat)
Fix
Use fileURLToPath(import.meta.url) from node:url. With that change the daemon spawns on Windows, but it then fails on the IPC socket (https://github.com/callstackincubator/agent-react-devtools/issues/65).
- 主要語言
- TypeScript
- 星號
- 251
- 分支
- 13
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
callstackincubator/agent-react-devtools 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
-
難度 2/5 1-3 小時 新手友好度 86/100
-
難度 3/5 1-2 天 新手友好度 68/100
-
難度 5/5 一週以上 新手友好度 42/100
-
enhancement
難度 5/5 一週以上 新手友好度 25/100
callstackincubator/agent-react-devtools#56 · 1 則留言 ·
查看 callstackincubator/agent-react-devtools 的全部 Issue
相似的 Issue
-
api bug priority:low ready-for-agent
難度 2/5 1-3 小時 新手友好度 78/100
wondermoney/wondermoney#862 ·
維護者通常 1 天內回覆
-
good first issue help wanted
難度 2/5 1-3 小時 新手友好度 84/100
rootsiemen/seo-agent-tools#70 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
alvinunreal/oh-my-opencode-slim#1971 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 77/100
elecnix/bellwether#467 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆