openclaw - ✅(Solved) Fix [Bug]: Windows + Node 24: ERR_UNSUPPORTED_ESM_URL_SCHEME breaks ALL agent tasks in 2026.4.24 (lane execution path) [2 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#72636Fetched 2026-04-28 06:33:51
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
cross-referenced ×2closed ×1

After upgrading from 2026.4.22 to 2026.4.24 on Windows with Node.js 24, every agent task (gateway lane execution) fails with:

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:'

This is not the same as #72573 (which only affects the browser plugin's OPENCLAW_BROWSER_CONTROL_MODULE). This bug affects the core agent execution path — all conversations, all channels (DingTalk, WeChat, Control UI webchat), all models. The gateway starts fine but every message results in "Something went wrong."

Downgrading to 2026.4.22 immediately resolves the issue.

Error Message

{ "0": "{"subsystem":"diagnostic"}", "1": "lane task error: lane=session:agent:main:main durationMs=400 error="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:'"", "meta": { "runtime": "node", "runtimeVersion": "24.14.0", "logLevelName": "ERROR", "path": { "fullFilePath": "file:///C:/Users/.../node_modules/openclaw/dist/subsystem-CWI_MDy.js:337:14" } } }

Root Cause

Root cause hypothesis

Fix Action

Fix / Workaround

Critical — 100% of agent tasks fail on Windows + Node.js 24. All channels affected (DingTalk, WeChat, Control UI). Only workaround is downgrading to 2026.4.22.

PR fix notes

PR #72716: fix(shared): normalize Windows dynamic import specifiers

Description (problem / solution / changelog)

fix(shared): normalize Windows dynamic import specifiers

Summary

Fixes a Windows + Node 24 regression where agent runtime dynamic imports could receive raw drive-letter paths (C:\...) and fail with ERR_UNSUPPORTED_ESM_URL_SCHEME.

Fixes #72636.

Root Cause

  • Node's ESM loader on Windows requires absolute paths to be imported as file:// URLs.
  • One runtime import path normalized module specifiers in plugin code, but shared runtime import helpers still had duplicated logic and incomplete reuse.
  • This left room for lane/runtime paths to pass non-URL Windows paths to import() in built environments.

What Changed

  • Added shared helper: src/shared/import-specifier.ts
    • exports toSafeImportPath(specifier) for Windows-safe dynamic import specifier normalization.
  • Updated src/plugins/import-specifier.ts
    • now re-exports from the shared helper to avoid duplicate implementations.
  • Updated src/shared/runtime-import.ts
    • toSafeRuntimeImportPath now delegates to the shared helper.
    • added resolveRuntimeImportSpecifier and ensured importRuntimeModule imports through normalized specifiers.
  • Added regression tests: src/shared/runtime-import.test.ts
    • verifies Windows absolute path and UNC conversion to file://.
    • verifies runtime import resolution from Windows absolute base paths.
    • verifies importRuntimeModule uses normalized specifiers.

Validation

  • pnpm test src/plugins/import-specifier.test.ts src/shared/runtime-import.test.ts
  • pnpm check:changed

Risk / Follow-up

  • Low risk: change is scoped to dynamic import specifier normalization and shared helper reuse.
  • Behavior on non-Windows platforms remains unchanged.

AI-assisted

  • AI-assisted and manually reviewed.

Changed files

  • src/plugins/import-specifier.ts (modified, +1/-19)
  • src/shared/import-specifier.ts (added, +19/-0)
  • src/shared/runtime-import.test.ts (added, +59/-0)
  • src/shared/runtime-import.ts (modified, +16/-1)

PR #72731: fix(agents): normalize Windows runtime imports

Description (problem / solution / changelog)

Summary

  • normalize shared lazy runtime import specifiers so Windows drive-letter paths become file:// URLs before Node ESM import
  • move the Windows import-specifier helper into shared code while preserving the plugin re-export
  • add regression coverage and route this bug class through Windows CI

Fixes

Fixes #72636 Carries forward #72716

Verification

  • pnpm test src/plugins/import-specifier.test.ts src/shared/runtime-import.test.ts
  • pnpm lint --threads=8
  • pnpm check:changed
  • pnpm build
  • pnpm test:windows:ci
  • pnpm test src/scripts/ci-changed-scope.test.ts src/shared/runtime-import.test.ts src/plugins/import-specifier.test.ts
  • git diff --check

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • docs/ci.md (modified, +1/-1)
  • extensions/qwen/plugin-registration.contract.test.ts (modified, +1/-1)
  • package.json (modified, +1/-1)
  • scripts/ci-changed-scope.mjs (modified, +2/-2)
  • src/plugin-activation-boundary.test.ts (modified, +2/-2)
  • src/plugins/import-specifier.ts (modified, +1/-19)
  • src/scripts/ci-changed-scope.test.ts (modified, +27/-0)
  • src/shared/import-specifier.ts (added, +19/-0)
  • src/shared/runtime-import.test.ts (added, +82/-0)
  • src/shared/runtime-import.ts (modified, +15/-1)
  • test/helpers/plugins/plugin-registration-contract-cases.ts (modified, +1/-1)
  • test/helpers/plugins/provider-contract.ts (modified, +11/-1)

Code Example

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:'

---

{
  "0": "{\"subsystem\":\"diagnostic\"}",
  "1": "lane task error: lane=session:agent:main:main durationMs=400 error=\"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:'\"",
  "_meta": {
    "runtime": "node",
    "runtimeVersion": "24.14.0",
    "logLevelName": "ERROR",
    "path": {
      "fullFilePath": "file:///C:/Users/.../node_modules/openclaw/dist/subsystem-CWI_MDy_.js:337:14"
    }
  }
}

---

Embedded agent failed before reply: 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:'
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

After upgrading from 2026.4.22 to 2026.4.24 on Windows with Node.js 24, every agent task (gateway lane execution) fails with:

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:'

This is not the same as #72573 (which only affects the browser plugin's OPENCLAW_BROWSER_CONTROL_MODULE). This bug affects the core agent execution path — all conversations, all channels (DingTalk, WeChat, Control UI webchat), all models. The gateway starts fine but every message results in "Something went wrong."

Downgrading to 2026.4.22 immediately resolves the issue.

Steps to reproduce

  1. Install OpenClaw 2026.4.24 globally on Windows (npm i -g [email protected])
  2. Use Node.js v24.14.0
  3. Start the gateway (openclaw gateway or via gateway.cmd)
  4. Send any message via any channel (control UI webchat, DingTalk, WeChat)
  5. Every agent task fails with ERR_UNSUPPORTED_ESM_URL_SCHEME

Expected behavior

Agent processes messages normally (as in 2026.4.22).

Actual behavior

Control UI shows: "Something went wrong while processing your request. Please try again, or use /new to start a fresh session."

Gateway log shows repeated errors:

{
  "0": "{\"subsystem\":\"diagnostic\"}",
  "1": "lane task error: lane=session:agent:main:main durationMs=400 error=\"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:'\"",
  "_meta": {
    "runtime": "node",
    "runtimeVersion": "24.14.0",
    "logLevelName": "ERROR",
    "path": {
      "fullFilePath": "file:///C:/Users/.../node_modules/openclaw/dist/subsystem-CWI_MDy_.js:337:14"
    }
  }
}

Followed by:

Embedded agent failed before reply: 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:'

49 occurrences observed in a single day of gateway uptime.

OpenClaw version

2026.4.24 (affected), 2026.4.22 (working)

Operating system

Windows 11

Install method

npm global

Model

github-copilot/claude-opus-4.6

Provider / routing chain

github-copilot

Logs, screenshots, and evidence

The error originates from dist/subsystem-CWI_MDy_.js in the agent lane execution path — not from the browser plugin service (which is #72573).

Impact and severity

Critical — 100% of agent tasks fail on Windows + Node.js 24. All channels affected (DingTalk, WeChat, Control UI). Only workaround is downgrading to 2026.4.22.

Additional information

Root cause hypothesis

Somewhere in the agent lane execution path introduced in 2026.4.24, a Windows absolute path (C:\...) is passed to a dynamic import() without being converted to a file:// URL via pathToFileURL(). Node.js ESM loader on Windows requires file:// scheme for absolute paths.

This is the same class of bug as #72573 (startLazyPluginServiceModule) but in a different code path (agent lane / embedded agent execution).

Suggested fix

Apply the same pathToFileURL / toSafeImportPath pattern used in src/plugins/loader.ts to all dynamic import() calls in the agent subsystem. A project-wide audit for bare await import(specifier) where specifier could be a Windows path would prevent future recurrence.

Related issues

  • #72573 — Same ERR_UNSUPPORTED_ESM_URL_SCHEME but only for browser plugin service (narrower scope)

extent analysis

TL;DR

The most likely fix is to apply the pathToFileURL pattern to dynamic import() calls in the agent subsystem to convert Windows absolute paths to file:// URLs.

Guidance

  • Verify that the issue is indeed caused by the ERR_UNSUPPORTED_ESM_URL_SCHEME error by checking the gateway logs for the specific error message.
  • Identify all dynamic import() calls in the agent subsystem that may be passing Windows absolute paths without conversion to file:// URLs.
  • Apply the pathToFileURL / toSafeImportPath pattern used in src/plugins/loader.ts to these import() calls to ensure proper URL scheme handling.
  • Perform a project-wide audit to prevent future recurrence of this issue.

Example

const specifier = 'C:\\\\\\path\\\\to\\\\module.js';
const safeSpecifier = pathToFileURL(specifier);
await import(safeSpecifier);

Notes

This fix assumes that the issue is indeed caused by the ERR_UNSUPPORTED_ESM_URL_SCHEME error and that applying the pathToFileURL pattern will resolve the issue. Further testing and verification may be necessary to confirm the fix.

Recommendation

Apply the workaround by converting Windows absolute paths to file:// URLs using the pathToFileURL pattern, as this is a critical issue affecting all agent tasks on Windows with Node.js 24.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Agent processes messages normally (as in 2026.4.22).

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING