Skip to content

Telegram channel crashes: Cannot find package 'json5' (ESM import failure in bundled deps) #75328

@erforschtbot-cmyk

Description

@erforschtbot-cmyk

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)

Field Value
"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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions