openclaw - 💡(How to fix) Fix [Bug]: ERR_INTERNAL_ASSERTION in ESM→CJS translator at gateway startup on both Node 22.22.2 and Node 24.15.0 (Linux)

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…

Gateway crashes at startup with ERR_INTERNAL_ASSERTION in Node's ESM→CJS module translator on Node 22.22.2 and Node 24.15.0; Node 22.17.1 is the only tested version that works.

Error Message

Gateway exits with code 1 immediately after [gateway] starting HTTP server....Crash stack on Node 22.22.2:[openclaw] Unhandled promise rejection: Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals. at async onImport.tracePromise.proto (node:internal/modules/esm/loader:665:26)Crash stack on Node 24.15.0 (different frame, same assertion class):[openclaw] Unhandled promise rejection: Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals. [openclaw] Unhandled promise rejection: Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals. Consequence: First-run failure on the documented recommended runtime. Users without prior Node experience hit a dead end; the error message ("bug in Node.js or incorrect usage of Node.js internals") gives no actionable next step. Native modules present in the install (all loaded ABI-cleanly on 22.17.1 after npm rebuild): tree-sitter-bash, koffi, @napi-rs/canvas, @mariozechner/clipboard, @lydell/node-pty. ABI mismatch ruled out (different error class, and npm rebuild on the failing Node versions did not help).

Root Cause

Gateway exits with code 1 immediately after [gateway] starting HTTP server....Crash stack on Node 22.22.2:[openclaw] Unhandled promise rejection: Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals. at assert (node:internal/assert:11:11) at cjsLoader (node:internal/modules/esm/translators:308:5) at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:202:7) at ModuleJob.run (node:internal/modules/esm/module_job:343:25) at async onImport.tracePromise.proto (node:internal/modules/esm/loader:665:26)Crash stack on Node 24.15.0 (different frame, same assertion class):[openclaw] Unhandled promise rejection: Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals. at assert (node:internal/assert:11:11) at loadCJSModuleWithModuleLoad (node:internal/modules/esm/translators:323:3) at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:231:7) at ModuleJob.run (node:internal/modules/esm/module_job:437:25) at async node:internal/modules/esm/loader:639:26Stability bundles written to ~/.openclaw/logs/stability/ for both crashes; can attach on request after redacting env/config.Likely a recurrence/variant of nodejs/node#59759 (ERR_INTERNAL_ASSERTION introduced in Node 22.18; 22.17.1 confirmed working).

Fix Action

Fix / Workaround

Workaround: pin Node to 22.17.1 with a systemd drop-in override pointing ExecStart at /usr/local/bin/node, plus apt-mark hold nodejs.

Code Example

[gateway] loading configuration…
[restart] lsof failed during initial stale-pid scan for port 18789: ENOENT
[gateway] resolving authentication…
[gateway] starting...
[gateway] auto-enabled plugins for this runtime without writing config:
- codex agent runtime configured, enabled automatically.
[gateway] starting HTTP server...
[openclaw] Unhandled promise rejection: Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
    at assert (node:internal/assert:11:11)
    at cjsLoader (node:internal/modules/esm/translators:308:5)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:202:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:343:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:665:26)
[openclaw] wrote stability bundle: ~/.openclaw/logs/stability/openclaw-stability-...-unhandled_rejection.json
systemd: openclaw-gateway.service: Main process exited, code=exited, status=1/FAILURE
systemd: openclaw-gateway.service: Consumed 14.5s CPU time, 474M memory peak.
RAW_BUFFERClick to expand / collapse

Bug type

Crash (process/app exits or hangs)

Beta release blocker

No

Summary

Gateway crashes at startup with ERR_INTERNAL_ASSERTION in Node's ESM→CJS module translator on Node 22.22.2 and Node 24.15.0; Node 22.17.1 is the only tested version that works.

Steps to reproduce

  1. Install Node 22.22.2 or Node 24.15.0 (NodeSource apt on Ubuntu 24.04).
  2. npm install -g [email protected]
  3. systemctl --user start openclaw-gateway.service
  4. Observe crash-loop in journalctl --user -u openclaw-gateway.service; port 18789 never binds.

Expected behavior

Gateway binds to 127.0.0.1:18789 and the WS connectivity probe succeeds, as it does on Node 22.17.1 with the same OpenClaw build, same workspace, and same systemd unit (only the node binary path differs).

Actual behavior

Gateway exits with code 1 immediately after [gateway] starting HTTP server....Crash stack on Node 22.22.2:[openclaw] Unhandled promise rejection: Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals. at assert (node:internal/assert:11:11) at cjsLoader (node:internal/modules/esm/translators:308:5) at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:202:7) at ModuleJob.run (node:internal/modules/esm/module_job:343:25) at async onImport.tracePromise.proto (node:internal/modules/esm/loader:665:26)Crash stack on Node 24.15.0 (different frame, same assertion class):[openclaw] Unhandled promise rejection: Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals. at assert (node:internal/assert:11:11) at loadCJSModuleWithModuleLoad (node:internal/modules/esm/translators:323:3) at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:231:7) at ModuleJob.run (node:internal/modules/esm/module_job:437:25) at async node:internal/modules/esm/loader:639:26Stability bundles written to ~/.openclaw/logs/stability/ for both crashes; can attach on request after redacting env/config.Likely a recurrence/variant of nodejs/node#59759 (ERR_INTERNAL_ASSERTION introduced in Node 22.18; 22.17.1 confirmed working).

OpenClaw version

2026.5.12 (f066dd2)

Operating system

Ubuntu 24.04 (Linux x86_64)

Install method

npm global (~/.npm-global)

Model

n/a — gateway never reaches model init

Provider / routing chain

n/a — gateway never reaches provider init

Additional provider/model setup details

n/a — crash is pre-init, no provider involvement.

Logs, screenshots, and evidence

[gateway] loading configuration…
[restart] lsof failed during initial stale-pid scan for port 18789: ENOENT
[gateway] resolving authentication…
[gateway] starting...
[gateway] auto-enabled plugins for this runtime without writing config:
- codex agent runtime configured, enabled automatically.
[gateway] starting HTTP server...
[openclaw] Unhandled promise rejection: Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
    at assert (node:internal/assert:11:11)
    at cjsLoader (node:internal/modules/esm/translators:308:5)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:202:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:343:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:665:26)
[openclaw] wrote stability bundle: ~/.openclaw/logs/stability/openclaw-stability-...-unhandled_rejection.json
systemd: openclaw-gateway.service: Main process exited, code=exited, status=1/FAILURE
systemd: openclaw-gateway.service: Consumed 14.5s CPU time, 474M memory peak.

Impact and severity

Affected: Linux users installing on Node 22.18+ or Node 24.x via NodeSource apt — the most common path for Ubuntu server installs and the runtime the README currently recommends. Severity: High — gateway never binds, OpenClaw is fully unusable until a different Node is installed. Frequency: 100% — reproducible across both crash variants, multiple restarts, fresh and existing workspaces. Consequence: First-run failure on the documented recommended runtime. Users without prior Node experience hit a dead end; the error message ("bug in Node.js or incorrect usage of Node.js internals") gives no actionable next step.

Additional information

Also a regression against the README, which states "Runtime: Node 24 (recommended) or Node 22.16+" — Node 24.15.0 is not actually safe.

Last known good Node: 22.17.1 (nodejs.org tarball). First known bad Node: 22.22.2 (NodeSource apt). Did not test the 22.18–22.21 range. Node 24.15.0 (NodeSource apt) also bad with a different translator frame.

Workaround: pin Node to 22.17.1 with a systemd drop-in override pointing ExecStart at /usr/local/bin/node, plus apt-mark hold nodejs.

Native modules present in the install (all loaded ABI-cleanly on 22.17.1 after npm rebuild): tree-sitter-bash, koffi, @napi-rs/canvas, @mariozechner/clipboard, @lydell/node-pty. ABI mismatch ruled out (different error class, and npm rebuild on the failing Node versions did not help).

Happy to provide the two stability bundles (~/.openclaw/logs/stability/openclaw-stability-2026-05-17T09-21-30-085Z-*-unhandled_rejection.json and the corresponding Node 24 one) after redacting env/config — just point me at the preferred redaction policy.

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

Gateway binds to 127.0.0.1:18789 and the WS connectivity probe succeeds, as it does on Node 22.17.1 with the same OpenClaw build, same workspace, and same systemd unit (only the node binary path differs).

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: ERR_INTERNAL_ASSERTION in ESM→CJS translator at gateway startup on both Node 22.22.2 and Node 24.15.0 (Linux)