fix: move undici to dependencies to fix Node.js startup hang when https_proxy is set

When https_proxy is configured, configureGlobalAgents() calls __require("undici")
synchronously. In the npm package, undici was listed as devDependencies and thus
absent from node_modules after installation. Node.js 22 would then attempt to load
its built-in ESM undici via CJS require(), causing an ESM/CJS interop deadlock that
hung the process indefinitely with no way to interrupt it.

Moving undici to dependencies ensures it is installed as a CJS-compatible module,
allowing __require("undici") to resolve correctly under Node.js.
This commit is contained in:
Askhz 2026-05-10 00:35:18 +08:00
parent 61b1b595bf
commit 636e40a991

View File

@ -63,7 +63,8 @@
"@agentclientprotocol/sdk": "^0.19.0", "@agentclientprotocol/sdk": "^0.19.0",
"@claude-code-best/mcp-chrome-bridge": "^2.0.8", "@claude-code-best/mcp-chrome-bridge": "^2.0.8",
"ws": "^8.20.0", "ws": "^8.20.0",
"gray-matter": "^4.0.3" "gray-matter": "^4.0.3",
"undici": "^7.24.6"
}, },
"devDependencies": { "devDependencies": {
"@alcalzone/ansi-tokenize": "^0.3.0", "@alcalzone/ansi-tokenize": "^0.3.0",