Windows: start fails because daemon path comes from URL.pathname
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- cli
Hướng nghiên cứu
Bắt đầu với packages/agent-react-devtools/src/daemon-client.ts tại phần tạo đường dẫn daemon và kiểm tra lỗi thời, sau đó xem xét thống kê buildMtime trong packages/agent-react-devtools/src/daemon.ts. Kiểm tra cách CLI suy ra đường dẫn từ import.meta.url, bao gồm ký tự ổ đĩa Windows và khoảng trắng được mã hóa; issue xác định fileURLToPath là cách chuyển đổi dự kiến. Hoàn tất khi đường dẫn tập lệnh daemon hợp lệ trên Windows và cài đặt hoạt động trong các đường dẫn có khoảng trắng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- TypeScript
- Star
- 251
- Fork
- 13
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của callstackincubator/agent-react-devtools
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
get component shows props and state as the dehydrated {data, cleaned, unserializable} wrapperĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 42/100
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
callstackincubator/agent-react-devtools#56 · 1 bình luận ·
Tất cả issue của callstackincubator/agent-react-devtools
Issue tương tự
-
api bug priority:low ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
wondermoney/wondermoney#862 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
rootsiemen/seo-agent-tools#70 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
alvinunreal/oh-my-opencode-slim#1971 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
elecnix/bellwether#467 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày