Skip to content

Video tab fails to start on Windows: --import receives a native path instead of a file:// URL (ERR_UNSUPPORTED_ESM_URL_SCHEME) #500

Open

Description

@sergotkvl

Video tab fails to start on Windows — --import receives a native path instead of a file:// URL

Summary

Opening the Video tab in DeepSeek Harness fails immediately. HyperFrames Studio is spawned with Node's --import flag receiving a native Windows path (C:\...) instead of a file:// URL, which the ESM loader rejects.

The Video tab is the only affected surface, because the faulty argument is added only for the preview subcommand. Every other Studio subcommand starts correctly.

Symptom

The tab shows:

HyperFrames Studio failed to start

node:internal/modules/esm/load:183
    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:183:11)
    at defaultLoad (node:internal/modules/esm/load:78:3)
    at ModuleLoader.load (node:internal/modules/loader:839:12)
    ...
  code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}

Node.js v24.9.0

HyperFrames Studio failed to start is not the root error — it is the wrapper at lib/runtime-*.js that surfaces the child's stderr. The real failure happens inside the spawned process before any application code runs, which is why the stack contains only Node internals.

Root cause

In external-plugins/deepseek-harness/video-studio/src/... (bundled to lib/runtime-*.js), the preview-owner guard path is built by converting a URL into a path:

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

fileURLToPath yields a native path such as:

C:\Users\<user>\...\deepseek-ivideo\lib\preview-owner-guard.js

That value is then passed straight into Node's --import flag:

// line ~16962
spawnCommand(args, cwd) {
    const ownsPreview = args[0] === "preview";
    return spawn(process.execPath, [
        ...ownsPreview ? ["--import", this.ownerGuardPath] : [],
        this.cliPath,
        ...args
    ], { /* ... */ });
}

--import expects a URL or a bare specifier. On Windows the loader parses C:\... as a URL with protocol c:, which is not in the supported scheme list, so the process exits before loading the module.

The conversion is therefore made in the wrong direction: URL → path at construction, where path → URL is required at the spawn site.

For reference, the bundled HyperFrames CLI does this correctly for the same flag:

// lib/hyperframes/cli.js line ~124650
import { fileURLToPath as fileURLToPath4, pathToFileURL } from "url";
// ...
inherited.push("--import", pathToFileURL(tsxEsm).href);

Reproduction

Minimal, no DSH involved:

GUARD="C:\Users\<user>\...\deepseek-ivideo\lib\preview-owner-guard.js"

# current behaviour — fails
node --import "$GUARD" -e "console.log('loaded ok')"
# Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: ... Received protocol 'c:'

# file:// URL — succeeds
node --import "file:///C:/Users/<user>/.../preview-owner-guard.js" -e "console.log('loaded ok')"
# loaded ok

Full Studio launch, as the plugin performs it:

node --import "file:///C:/.../preview-owner-guard.js" \
     "<dsh>/profiles/web/node_modules/deepseek-ivideo/lib/hyperframes/cli.js" \
     preview "<project-dir>" --port 7317 --no-open
# Studio running — http://localhost:7317

Proposed fix

Two lines. Convert at the spawn site rather than at construction, so ownerGuardPath keeps its current meaning as a path and no other call site is affected.

-import { fileURLToPath } from "node:url";
+import { fileURLToPath, pathToFileURL } from "node:url";
-	...ownsPreview ? ["--import", this.ownerGuardPath] : [],
+	...ownsPreview ? ["--import", pathToFileURL(this.ownerGuardPath).href] : [],

Verification

With the patch applied on Windows (Node v24.9.0, deepseek-ivideo 0.5.0):

Check Before After
Studio process ERR_UNSUPPORTED_ESM_URL_SCHEME Studio running
TCP port — listening
GET / — 200, 1947 bytes

No other Windows-specific failure was found in the same launch path: --import appears exactly once in the runtime bundle, and the remaining dynamic import() call sites in lib/hyperframes/cli.js all use relative specifiers (./commands/..., ../background-removal/pipeline.ts), which resolve correctly.

Why CI did not catch this

fileURLToPath() accepts file:// URLs and returns a platform-correct path on every OS, and a bare Windows path happens to be a valid --import argument nowhere at all — but the failure only materialises on Windows, where the native path collides with URL scheme parsing. On macOS and Linux the resulting string (/Users/..., /home/...) is treated as a relative specifier and resolves against the process CWD, so the guard silently fails to load instead of crashing. Either way, cross-platform CI on Linux or macOS will not surface this as a test failure.

A regression guard would be to assert the --import argument starts with file:// (or data: / node:) before spawning.

Environment

  • OS: Windows (reported on Windows 10)
  • Node.js: v24.9.0
  • deepseek-ivideo: 0.5.0
  • DeepSeek Harness Video tab (HyperFrames Studio)

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions