openclaw - 💡(How to fix) Fix Telegram channel crashes: Cannot find package 'json5' (ESM import failure in bundled deps) [1 comments, 2 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#75328Fetched 2026-05-01 05:35:08
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
2
Timeline (top)
cross-referenced ×2closed ×1commented ×1subscribed ×1

Error Message

Cannot find package 'json5' imported from
/home/openclaw/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-67e811bb8931/dist/frontmatter-Cc-V8aI2.js

Did you mean to import "json5/lib/index.js"?

Root Cause

Root Cause Analysis

Fix Action

Workaround

Manually running the gateway with --input-type=module or deleting and re-creating the plugin-runtime-deps directory sometimes temporarily resolves it, but it returns after gateway restart.

Code Example

Cannot find package 'json5' imported from
/home/openclaw/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-67e811bb8931/dist/frontmatter-Cc-V8aI2.js

Did you mean to import "json5/lib/index.js"?

---

import JSON5 from "json5";
RAW_BUFFERClick to expand / collapse

Version

OpenClaw 2026.4.29 (a448042)

Environment

  • OS: CachyOS (Arch Linux), Kernel 6.19.12-1
  • Node: v25.9.0
  • Install: npm global (npm install -g [email protected])
  • Hardware: Dell Latitude 5300

Symptoms

Telegram channel continuously crashes on startup. Auto-restart runs through all 10 attempts with exponential backoff, then the channel remains dead. Health monitor also triggers restarts but they all fail the same way.

Error

Cannot find package 'json5' imported from
/home/openclaw/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-67e811bb8931/dist/frontmatter-Cc-V8aI2.js

Did you mean to import "json5/lib/index.js"?

Root Cause Analysis

The import

File: dist/frontmatter-Cc-V8aI2.js, line 5:

import JSON5 from "json5";

json5 package state (v2.2.3)

FieldValue
"type"None (not "module")
"exports"None (no ESM export map)
"main"lib/index.js (CJS: uses require/module.exports)
"module"dist/index.mjs (ESM build exists, but not declared in "exports")

Parent bundle

plugin-runtime-deps/openclaw-2026.4.29-.../package.json has no "type" field → Node treats .js files as CJS. When frontmatter-Cc-V8aI2.js uses an ESM import statement in a CJS context, Node tries to resolve json5 as ESM but can't find the entry point because json5 doesn't declare "exports".

Also imports YAML

The same file also does import YAML from "yaml" - this works because the yaml package properly declares ESM exports. Only json5 is affected.

Affected callers

frontmatter-Cc-V8aI2.js is imported by:

  • config-BUXinPt_.js
  • frontmatter-CLCliW2L.js
  • skills-CgFdJ7jF.js

Impact

Telegram channel is completely non-functional in this release. All other channels that use the same frontmatter code path may also be affected.

Workaround

Manually running the gateway with --input-type=module or deleting and re-creating the plugin-runtime-deps directory sometimes temporarily resolves it, but it returns after gateway restart.

Regression

Version 2026.4.23 worked correctly.

extent analysis

TL;DR

The most likely fix is to update the json5 package to a version that properly declares ESM exports or to modify the frontmatter-Cc-V8aI2.js file to use a compatible import statement.

Guidance

  • Verify that the issue is indeed caused by the json5 package not declaring ESM exports by checking the package.json file of the json5 package.
  • Consider updating the json5 package to a version that supports ESM exports, if available.
  • As a temporary workaround, try running the gateway with the --input-type=module flag to force Node to treat the .js files as ESM.
  • Investigate modifying the frontmatter-Cc-V8aI2.js file to use a compatible import statement, such as importing from json5/lib/index.js as suggested by the error message.

Example

// Instead of:
import JSON5 from "json5";
// Try:
import JSON5 from "json5/lib/index.js";

Notes

The issue seems to be specific to the json5 package and its lack of ESM export declaration. Other packages, such as yaml, are not affected because they properly declare ESM exports.

Recommendation

Apply the workaround by modifying the frontmatter-Cc-V8aI2.js file to use a compatible import statement, as this is a more targeted and reliable solution than relying on the --input-type=module flag.

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