node 24 启动Failed to load plugins client-modules: HTML did not preload #4885
Replies: 5 comments
|
听我说,你是我的英雄,你帮我节省了很多token,直接告诉oh my pi去改你说的这里就好了 |
|
The handbook now covers this Node 24 resolver-signature path in v0.5.271. It separates the Host-side resolveSync failure and empty client table from downstream browser preload symptoms, and includes a pinned Node comparison plus rebuild evidence.\n\nGuide: https://github.com/sandbaseai/deepseek-harness-handbook/blob/main/docs/en/troubleshooting/client-modules-html-did-not-preload.md#check-the-node-resolver-signature-before-blaming-the-browser\nRelease: https://github.com/sandbaseai/deepseek-harness-handbook/releases/tag/v0.5.271\n\nIndependent community documentation; the upstream repository remains the source of truth. |
|
@liyangbing 补充复现与验证数据,楼主的结论完整复现: 复现范围:Node 24.11.1(当前最新 24.x)。官方源码 git diff 为空,headless 正常,仅 web profile 受影响。 失败机制:vendor/loader/src/internal.ts 的 ModuleLoader.fromInternal 按 Node 主版本给内部 loader 标记 version: 'v2',但 24.11.1 内部的 resolveSync 实际是 v1 顺序 (specifier, parentURL, importAttributes)(node --expose-internals 实测:resolveSync(specifier, parentURL, 错误消息随 Node 小版本而异,但根因相同:24.9.0 报 The "parentURL" argument must be of type string or an instance of URL;24.11.1 报 e.indexOf is not a function。搜到任一报错的人都应对到这个根因。 修复建议:直接改回 v1 传参当下可用;若未来某个 Node 24.x 真正落地 request-object 形状,硬编码 v1 会反向踩坑。两种形状都能被探测覆盖:resolveSync 调用前各用 resolveSync('node:os', baseUrl, …) 试探一次并缓存可用形状,Node 22/24 及未来版本都成立;或在 验证清单(Node 22.23.2 下全部通过):curl 首页 → DSH_BOOT.entries 非空 → 存在 <script src="/plugins/??@deepseek-ai/dsh-client-modules/client.js&rev=..."> 阻塞脚本 → 该 URL 返回 200。 |
|
Node 升到 >= 24.12 就行了,不用换 Node 22。代码等官方改,对 node 版本判断太粗了 根因分析 |
|
Fix proposal with patch + real-machine verification (Node 24.11.1 reproduced and fixed; 24.19 no-regression): #4968 — root cause is vendor/loader tagging every Node >= 24 as v2 while the v2 resolveSync signature lands only in 24.12.0; the client-modules locatePkgJson now probes the actual loader shape. Patch: https://gist.github.com/Shizuku-keop/a471fe04621f416cb34138a0d1eb44b0 |
Uh oh!
There was an error while loading. Please reload this page.
node 24.9.0版本下,启动服务会报错:
换成Node 22版本就可以了。Bug的原因是:
packages/client/modules/src/index.ts
resolveSync函数的入参传错了。
vendor/loader 的类型注释声称 v2 签名是 resolveSync(parentURL, request),但真实的 Node 24.9.0 实现是 resolveSync(specifier, parentURL, importAttributes)。代码按错误的签名调用,导致 resolveSync 抛出 TypeError: The "parentURL" argument must be of type string or an instance of URL,被 catch 吞掉后返回 undefined,所有 client 包都无法解析,整张 client 表为空 → HTML 不预加载 → 浏览器报 "HTML did not preload ... client.js"。
改为和v1版本一致的传参即可。

All reactions