Windows: daemon IPC listens on a Unix socket path (EACCES); needs a named pipe

Đang mở
#65 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/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
backend, devtools

Hướng nghiên cứu

Start with getSocketPath() in packages/agent-react-devtools/src/daemon.ts and src/daemon-client.ts, then check the daemon IPC listen and cleanup paths. Verify that Windows uses a named pipe consistently for the daemon and client, while other platforms retain the socket path. Run the daemon and exercise start, status, get tree, and get component on Windows; those commands should work without the EACCES error.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

On Windows the daemon cannot start its IPC server. It listens on the file path <stateDir>/daemon.sock; on Windows, net.Server.listen takes only named pipes (\\.\pipe\...) for IPC.

Environment

  • agent-react-devtools 0.5.0 (same code on main @ d25f34b)
  • Node 26.8.1
  • Windows 11 (10.0.26100)

Repro

Run the daemon directly (start does not reach this point on Windows because of https://github.com/callstackincubator/agent-react-devtools/issues/64):

> node node_modules/agent-react-devtools/dist/daemon.js --port=8098 --state-dir=D:\temp\ard\state
Failed to start daemon: Error: listen EACCES: permission denied D:\temp\ard\state\daemon.sock
    at Server.setupListenHandle [as _listen2] (node:net:2306:21)
    at listenInCluster (node:net:2437:12)
    at Server.listen (node:net:2579:5)
    at .../agent-react-devtools/dist/daemon.js:1277:22
    at Daemon.startIpc (.../agent-react-devtools/dist/daemon.js:1250:12)
  code: 'EACCES', syscall: 'listen'

Cause

getSocketPath() in daemon.ts L17 and daemon-client.ts L23 returns path.join(stateDir, 'daemon.sock') on every platform; daemon.ts L136 listens on it.

Fix

On win32, use a named pipe derived from the state dir in both files, for example:

process.platform === 'win32'
  ? `\\\\.\\pipe\\agent-react-devtools-${hash(stateDir)}`
  : path.join(stateDir, 'daemon.sock');

With this change plus fileURLToPath for the script path, start, status, get tree, and get component all work on Windows. The unlinkSync(socketPath) cleanup can be skipped for pipes.

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của callstackincubator/agent-react-devtools

Tất cả issue của callstackincubator/agent-react-devtools

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.