openclaw - 💡(How to fix) Fix After upgrade to 4.29: Gateway starts but all bundled channels crash — missing json5 in plugin-runtime-deps [2 comments, 3 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#76088Fetched 2026-05-03 04:42:33
View on GitHub
Comments
2
Participants
3
Timeline
4
Reactions
2
Author
Timeline (top)
commented ×2closed ×1unsubscribed ×1

Root Cause

The bundled dist/frontmatter-*.js and dist/redact-*.js files contain:

import JSON5 from "json5";

However, json5 is not declared in the runtime-deps package.json dependencies. When the runtime-deps directory is built during upgrade, json5 is not installed, causing ESM resolution to fail.

Fix Action

Workaround

Manually place json5 without triggering npm resolution:

cd ~/.openclaw/plugin-runtime-deps/openclaw-*-*/node_modules/
npm pack [email protected] --pack-destination /tmp/
tar xzf /tmp/json5-2.2.3.tgz
mv package json5
rm /tmp/json5-2.2.3.tgz
# No gateway restart needed — json5 will be resolved on next import

Code Example

Cannot find package 'json5' imported from 
  ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-96928547ff78/dist/frontmatter-Cc-V8aI2.js

---

Cannot find package 'json5' imported from 
  ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.26-96928547ff78/dist/redact-Cv5sPU4g.js

---

import JSON5 from "json5";

---

cd ~/.openclaw/plugin-runtime-deps/openclaw-*-*/node_modules/
npm pack json5@2.2.3 --pack-destination /tmp/
tar xzf /tmp/json5-2.2.3.tgz
mv package json5
rm /tmp/json5-2.2.3.tgz
# No gateway restart needed — json5 will be resolved on next import
RAW_BUFFERClick to expand / collapse

Bug Description

After upgrading from 2026.4.26 to 2026.4.29 (and also reproducible on 4.26), all bundled channel plugins (Telegram, Discord, WhatsApp) crash on startup with:

Cannot find package 'json5' imported from 
  ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-96928547ff78/dist/frontmatter-Cc-V8aI2.js

and

Cannot find package 'json5' imported from 
  ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.26-96928547ff78/dist/redact-Cv5sPU4g.js

The Gateway process itself starts fine, but no messaging channels are functional.

Root Cause

The bundled dist/frontmatter-*.js and dist/redact-*.js files contain:

import JSON5 from "json5";

However, json5 is not declared in the runtime-deps package.json dependencies. When the runtime-deps directory is built during upgrade, json5 is not installed, causing ESM resolution to fail.

Impact

  • All bundled channels (Telegram, Discord, WhatsApp) crash in a restart loop (auto-restart 1-10/10)
  • Gateway remains running but no messaging channels are functional
  • The issue persists across gateway restarts until manually resolved
  • During upgrade, also observed two earlier-stage errors before json5:
    • Cannot find module 'plugin-sdk/root-alias.cjs/bundled-channel-config-schema'
    • Cannot find module '../dist/babel.cjs' (jiti)

Steps to Reproduce

  1. Upgrade from 4.26 to 4.29 via npm install -g [email protected] or openclaw update
  2. Gateway restarts and rebuilds runtime-deps
  3. json5 is missing from node_modules/ in the new runtime-deps
  4. All bundled channels crash with Cannot find package 'json5'

Additional Issue: npm install destroys runtime-deps

Attempting to fix by running npm install json5 inside the runtime-deps directory triggers npm dependency resolution, which prunes all packages not in package.json (removed 144–468 packages in our tests). This appears related to #74949 but the fix in 4.29 does not cover json5.

Workaround

Manually place json5 without triggering npm resolution:

cd ~/.openclaw/plugin-runtime-deps/openclaw-*-*/node_modules/
npm pack [email protected] --pack-destination /tmp/
tar xzf /tmp/json5-2.2.3.tgz
mv package json5
rm /tmp/json5-2.2.3.tgz
# No gateway restart needed — json5 will be resolved on next import

Environment

  • OS: Linux 6.17.0-22-generic (x64)
  • Node: v25.8.1
  • OpenClaw: 2026.4.26 → 2026.4.29 (reproduced on both versions)
  • Install method: npm global
  • Channels affected: Telegram, Discord, WhatsApp (all bundled channels)
  • Feishu (openclaw-lark): Not affected (external plugin, separate resolution)

extent analysis

TL;DR

Manually installing json5 in the runtime-deps directory without triggering npm resolution can resolve the issue.

Guidance

  • The root cause is the missing json5 package in the runtime-deps directory, which is not declared in the package.json dependencies.
  • To verify the issue, check if json5 is present in the node_modules directory of the runtime-deps.
  • The provided workaround can be used to manually install json5 without triggering npm resolution.
  • Be cautious when running npm install in the runtime-deps directory, as it may prune packages not listed in package.json.

Example

The workaround provided in the issue can be used to manually install json5:

cd ~/.openclaw/plugin-runtime-deps/openclaw-*-*/node_modules/
npm pack [email protected] --pack-destination /tmp/
tar xzf /tmp/json5-2.2.3.tgz
mv package json5
rm /tmp/json5-2.2.3.tgz

Notes

This solution assumes that the issue is specific to the missing json5 package and that manually installing it will resolve the issue. However, the underlying problem of npm install pruning packages not listed in package.json may still exist and should be addressed separately.

Recommendation

Apply the provided workaround to manually install json5 in the runtime-deps directory, as it is a targeted solution to the specific issue at hand.

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…

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 After upgrade to 4.29: Gateway starts but all bundled channels crash — missing json5 in plugin-runtime-deps [2 comments, 3 participants]