Skip to content

[deepseek-ivideo] Windows 下打开 iVideo 视图崩溃:ERR_UNSUPPORTED_ESM_URL_SCHEME(--import 收到裸 Windows 路径) #467

Description

@LessXi

问题描述

deepseek-ivideo@0.1.0 在 Windows 上无法使用:在 dsh web 对话中切换到 Video 视图时,界面提示「iVideo 暂时无法打开」,HyperFrames 预览子进程启动即崩溃。macOS / Linux 不受影响。

复现步骤

  1. 环境:Windows 11 x64、Node v24.15.0、dsh 0.1.5-rc.2
  2. dsh plugin --profile web add deepseek-ivideo 后启动 dsh web
  3. 在任意对话中切换到 Video 视图

实际行为

预览子进程立即退出,捕获到的输出:

node:internal/modules/esm/load:195
throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(parsed, schemes);
^
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node
are supported by the default ESM loader. On Windows, absolute paths must be valid
file:// URLs. Received protocol 'c:'
    at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:195:11)
    at defaultLoadSync (node:internal/modules/esm/load:142:3)
    ...
Node.js v24.15.0

根因

external-plugins/deepseek-harness/video-studio 的构建产物 lib/runtime-*.js 中,VideoRuntimeManager 构造函数把 ownerGuardPath 存成了裸文件系统路径:

this.ownerGuardPath = fileURLToPath(new URL("./preview-owner-guard.js", import.meta.url));

它唯一的消费点 spawnCommand 将该值直接传给 node 的 --import:

return spawn(process.execPath, [
  ...ownsPreview ? ["--import", this.ownerGuardPath] : [],
  this.cliPath,
  ...args
], ...);

--import 只接受 URL 或模块说明符。Windows 裸路径 C:\... 会被解析为协议为 c: 的 URL,于是抛出 ERR_UNSUPPORTED_ESM_URL_SCHEME。POSIX 绝对路径恰好是合法说明符,所以在 macOS / Linux 上不会复现——这也是它容易被漏测的原因。

修复建议

给 --import 传 file URL 而不是裸路径,二选一:

// 方案 A:构造函数里直接存 URL
this.ownerGuardPath = new URL("./preview-owner-guard.js", import.meta.url).href;

// 方案 B:spawn 处转换
...ownsPreview ? ["--import", pathToFileURL(this.ownerGuardPath).href] : [],

我在 Windows 11 + Node 24 上按方案 A 本地验证过:预览进程可以正常加载 guard 并启动。

Windows 用户临时规避

手动修改 ~/.dsh/profiles/web/node_modules/deepseek-ivideo/lib/runtime-*.js 中 ownerGuardPath 的赋值行(方案 A),重启 dsh web 即可。注意插件重装/升级会覆盖该修改。

环境

  • OS: Windows 11 Pro x64 (10.0.26100)
  • Node: v24.15.0
  • dsh: 0.1.5-rc.2
  • deepseek-ivideo: 0.1.0(npm 上当前唯一版本)
  • hyperframes: 0.7.60

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions