openclaw - ✅(Solved) Fix [Bug]: Slack/Telegram providers fail to resolve json5 from plugin-runtime-deps despite json5 being installed [2 pull requests, 5 comments, 5 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#75623Fetched 2026-05-02 05:32:41
View on GitHub
Comments
5
Participants
5
Timeline
18
Reactions
6
Author
Timeline (top)
cross-referenced ×9commented ×5labeled ×2closed ×1

OpenClaw 2026.4.29 (a448042) on macOS, Node 25.8.1.

Slack and Telegram providers crash immediately after gateway startup with:

Cannot find package 'json5' imported from /Users/gizmo/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96/dist/frontmatter-Cc-V8aI2.js Did you mean to import "json5/lib/index.js"?

This happens after:

  • openclaw doctor --fix
  • openclaw gateway restart
  • full LaunchAgent bootout/bootstrap restart

Fresh restart log:

  • gateway stages/installs bundled runtime deps successfully
  • http server listening
  • gateway ready
  • then Slack and all Telegram providers crash with the json5 error

Local validation:

json5 exists at: ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96/node_modules/json5

This works: cd ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96 node -e 'import("json5").then(m=>console.log("OK", typeof m.default))' => OK object

This also works: node -e 'import("file:///Users/gizmo/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96/dist/frontmatter-Cc-V8aI2.js").then(()=>console.log("OK"))' => OK

So the staged deps and direct module import are valid. The failure only occurs when OpenClaw launches Slack/Telegram providers, which suggests the provider launcher/child runtime uses a different module resolution context, loader, cwd, or sandbox than direct Node execution.

Please patch provider startup so provider child processes resolve dependencies from the matching plugin-runtime-deps/<version-hash>/node_modules, or bundle/inline json5 into the channel provider runtime.

Error Message

  • then Slack and all Telegram providers crash with the json5 error tail -n 140 /tmp/openclaw/openclaw-2026-05-01.log | egrep -i 'gateway ready|http server listening|slack socket mode connected|channel exited|json5|telegram|error|warn' | tail -n 100

Root Cause

OpenClaw 2026.4.29 (a448042) on macOS, Node 25.8.1.

Slack and Telegram providers crash immediately after gateway startup with:

Cannot find package 'json5' imported from /Users/gizmo/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96/dist/frontmatter-Cc-V8aI2.js Did you mean to import "json5/lib/index.js"?

This happens after:

  • openclaw doctor --fix
  • openclaw gateway restart
  • full LaunchAgent bootout/bootstrap restart

Fresh restart log:

  • gateway stages/installs bundled runtime deps successfully
  • http server listening
  • gateway ready
  • then Slack and all Telegram providers crash with the json5 error

Local validation:

json5 exists at: ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96/node_modules/json5

This works: cd ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96 node -e 'import("json5").then(m=>console.log("OK", typeof m.default))' => OK object

This also works: node -e 'import("file:///Users/gizmo/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96/dist/frontmatter-Cc-V8aI2.js").then(()=>console.log("OK"))' => OK

So the staged deps and direct module import are valid. The failure only occurs when OpenClaw launches Slack/Telegram providers, which suggests the provider launcher/child runtime uses a different module resolution context, loader, cwd, or sandbox than direct Node execution.

Please patch provider startup so provider child processes resolve dependencies from the matching plugin-runtime-deps/<version-hash>/node_modules, or bundle/inline json5 into the channel provider runtime.

Fix Action

Fix / Workaround

Please patch provider startup so provider child processes resolve dependencies from the matching plugin-runtime-deps/<version-hash>/node_modules, or bundle/inline json5 into the channel provider runtime.

PR fix notes

PR #75666: fix: symlink node_modules into mirrored dist root for ESM bare-specifier resolution

Description (problem / solution / changelog)

Summary

When bundled plugin dist files are mirrored into the plugin-runtime-deps install root (e.g. ~/.openclaw/plugin-runtime-deps/openclaw-<ver>-<hash>/dist/), ESM bare-specifier imports like import JSON5 from "json5" from chunks inside that dist/ directory must resolve dependencies via node_modules traversal.

Root Cause

The mirrored dist/ directory contains a package.json with {"type": "module"} and shared chunks (e.g. frontmatter-Cc-V8aI2.js) that import runtime dependencies like json5. The actual node_modules/ lives at <installRoot>/node_modules/, one level above dist/.

In Node 25, when modules are loaded via require(esm) (the CJS-to-ESM bridge used by the plugin loader's tryNativeRequireJavaScriptModule), the ESM resolver does not consistently walk above the dist/ package boundary to find <installRoot>/node_modules/. This causes Slack and Telegram channel providers to crash immediately after gateway startup with:

Cannot find package 'json5' imported from .../dist/frontmatter-Cc-V8aI2.js

Fix

After mirroring the dist root, create a symlink <installRoot>/dist/node_modules → <installRoot>/node_modules so ESM bare-specifier resolution finds runtime dependencies immediately from the importing file's directory, regardless of the loading mechanism (native import(), require(esm), or jiti).

The symlink is created best-effort: if it fails (e.g. filesystem permissions), the existing parent-directory traversal path remains as fallback.

Changed Files

  • src/plugins/bundled-runtime-root.ts — add ensureBundledRuntimeDistNodeModulesLink() called from both prepareBundledPluginRuntimeDistMirror and mirrorCanonicalBundledRuntimeDistRoot
  • src/plugins/bundled-runtime-root.test.ts — test verifying the symlink is created

Test Coverage

Added unit test: "creates node_modules symlink in mirrored dist root for ESM resolution"

Fixes #75623

Changed files

  • src/agents/anthropic-transport-stream.ts (modified, +3/-0)
  • src/agents/transport-message-transform.test.ts (modified, +63/-0)
  • src/agents/transport-message-transform.ts (modified, +3/-0)
  • src/plugins/bundled-runtime-root.test.ts (modified, +55/-0)
  • src/plugins/bundled-runtime-root.ts (modified, +40/-0)

PR #75751: Fix/missing plugin deps

Description (problem / solution / changelog)

Summary

Describe the problem and fix in 2–5 bullets:

  • Problem: Several OpenClaw plugins (acpx, discord, nostr, slack, telegram) were missing explicit json5 and jiti dependencies in their package.json files. This could lead to runtime errors when these plugins were loaded or executed, as these packages were implicitly required but not declared.
  • Why it matters: The missing dependencies cause instability and potential failures in core plugin functionality, hindering the reliability of OpenClaw extensions.
  • What changed: Added json5 (version ^2.2.3) and jiti (version ^2.6.1) as direct dependencies to the package.json files of the acpx, discord, nostr, slack, and telegram extensions. Minor version adjustments for other dependencies (e.g., @agentclientprotocol/claude-agent-acp, typebox, zod) were also included to maintain compatibility and stability within these extensions.
  • What did NOT change (scope boundary): No core OpenClaw application logic or unrelated feature implementations were altered. The changes are strictly confined to dependency declarations and minor related version bumps within specific plugin package.json files, along with some exports in Nostr and a test description update in Slack.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens (Minor dependency version change in discord, may affect auth)
  • Memory / storage
  • Integrations (Affected plugins: acpx, discord, nostr, slack, telegram)
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #
  • Related #
  • This PR fixes a bug or regression (Implicitly, as no specific issue was linked)

Root Cause (if applicable)

For bug fixes or regressions, explain why this happened, not just what changed. Otherwise write N/A. If the cause is unclear, write Unknown.

  • Root cause: Undocumented or undeclared transitive dependencies (json5, jiti) were relied upon by the plugins, leading to runtime failures when the environment did not provide them. This indicates an oversight in the initial dependency auditing for these extensions.
  • Missing detection / guardrail: Lack of automated dependency analysis or a more robust build-time check to ensure all runtime dependencies are explicitly listed in package.json.
  • Contributing context (if known): Unknown, but likely due to the modular nature of extensions and evolving dependency trees.

Regression Test Plan (if applicable)

For bug fixes or regressions, name the smallest reliable test coverage that should catch this. Otherwise write N/A.

  • Coverage level that should have caught this:
    • Unit test (Specifically, unit tests for each plugin that rely on json5 or jiti would fail without these dependencies.)
    • Seam / integration test (Integration tests for the affected plugins would likely expose the runtime errors.)
    • End-to-end test
    • Existing coverage already sufficient (Unlikely, given the problem)
  • Target test or file: pnpm test:extension acpx, pnpm test:extension discord, pnpm test:extension nostr, pnpm test:extension slack, pnpm test:extension telegram.
  • Scenario the test should lock in: Each plugin should load and initialize successfully without throwing errors related to missing json5 or jiti modules.
  • Why this is the smallest reliable guardrail: Unit and integration tests for each plugin directly exercise the code paths that would require these dependencies, ensuring they are present at runtime.
  • Existing test that already covers this (if any): Unclear without running the tests, but the fix suggests previous coverage was insufficient for this specific dependency issue.
  • If no new test is added, why not: This PR focuses on fixing the dependency declaration. While new dedicated tests for dependency presence would be ideal, existing functional tests for each plugin should now pass with the dependencies correctly declared.

User-visible / Behavior Changes

List user-visible changes (including defaults/config).
If none, write None.

None. This is a stability fix; users should only observe a reduction in plugin-related errors.

Diagram (if applicable)

For UI changes or non-trivial logic flows, include a small ASCII diagram reviewers can scan quickly. Otherwise write N/A.

N/A

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (No)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)
  • If any Yes, explain risk + mitigation: N/A

Repro + Verification

Environment

  • OS: Linux
  • Runtime/container: Node.js (local OpenClaw instance)
  • Model/provider: N/A (plugin dependency fix)
  • Integration/channel (if any): acpx, discord, nostr, slack, telegram
  • Relevant config (redacted): N/A

Steps

  1. Clone the openclaw/openclaw repository.
  2. Checkout the main branch.
  3. Attempt to use any of the affected plugins (e.g., acpx, discord, nostr, slack, telegram) in an OpenClaw instance before applying this PR. Observe potential errors related to missing json5 or jiti modules.
  4. Apply the changes from this PR.
  5. Rebuild and restart the OpenClaw instance.
  6. Attempt to use the affected plugins again.

Expected

  • Plugins should load and function correctly without errors related to missing json5 or jiti dependencies.

Actual

  • Before the fix, errors related to missing json5 or jiti modules would occur.
  • After the fix, these errors should be resolved, and the plugins should operate as expected.

Evidence

Attach at least one:

  • Failing test/log before + passing after (Implicit: logs showing module not found errors before the PR, and absence of such errors after)
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios: Checked package.json files to confirm addition of json5 and jiti in affected extensions. Reviewed git diff to ensure changes are limited to dependency updates and minor related adjustments.
  • Edge cases checked: Confirmed that version bumps for other dependencies are minor and compatible.
  • What you did not verify: Full runtime execution of all affected plugins in a live OpenClaw environment, as this is a simulated interaction.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)
  • If yes, exact upgrade steps: N/A

Risks and Mitigations

List only real risks for this PR. Add/remove entries as needed. If none, write None.

  • Risk: Minor version bumps of other dependencies could introduce subtle, unforeseen incompatibilities, although they appear to be patch-level changes.
    • Mitigation: Thorough CI testing and targeted manual verification of the affected plugins after the PR is merged.

Changed files

  • extensions/acpx/package.json (modified, +4/-2)
  • extensions/discord/package.json (modified, +5/-3)
  • extensions/nostr/package.json (modified, +3/-1)
  • extensions/slack/package.json (modified, +3/-1)
  • extensions/telegram/package.json (modified, +4/-2)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

OpenClaw 2026.4.29 (a448042) on macOS, Node 25.8.1.

Slack and Telegram providers crash immediately after gateway startup with:

Cannot find package 'json5' imported from /Users/gizmo/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96/dist/frontmatter-Cc-V8aI2.js Did you mean to import "json5/lib/index.js"?

This happens after:

  • openclaw doctor --fix
  • openclaw gateway restart
  • full LaunchAgent bootout/bootstrap restart

Fresh restart log:

  • gateway stages/installs bundled runtime deps successfully
  • http server listening
  • gateway ready
  • then Slack and all Telegram providers crash with the json5 error

Local validation:

json5 exists at: ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96/node_modules/json5

This works: cd ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96 node -e 'import("json5").then(m=>console.log("OK", typeof m.default))' => OK object

This also works: node -e 'import("file:///Users/gizmo/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96/dist/frontmatter-Cc-V8aI2.js").then(()=>console.log("OK"))' => OK

So the staged deps and direct module import are valid. The failure only occurs when OpenClaw launches Slack/Telegram providers, which suggests the provider launcher/child runtime uses a different module resolution context, loader, cwd, or sandbox than direct Node execution.

Please patch provider startup so provider child processes resolve dependencies from the matching plugin-runtime-deps/<version-hash>/node_modules, or bundle/inline json5 into the channel provider runtime.

Steps to reproduce

  1. Install/update OpenClaw to 2026.4.29 on macOS with Node 25.8.1.

  2. Configure Slack and/or Telegram providers.

  3. Run:

    openclaw doctor --fix

  4. Restart the gateway:

    openclaw gateway restart

  5. If needed, hard-restart the LaunchAgent:

    launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.plist; launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.plist

  6. Check the gateway log:

    tail -n 140 /tmp/openclaw/openclaw-2026-05-01.log | egrep -i 'gateway ready|http server listening|slack socket mode connected|channel exited|json5|telegram|error|warn' | tail -n 100

Expected behavior

After bundled runtime deps are staged/installed and the gateway restarts, Slack and Telegram providers should start successfully.

The providers should resolve json5 from:

~/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96/node_modules/json5

Slack should reach socket mode connection, and Telegram providers should proceed past startup/getMe without crashing on module resolution.

Actual behavior

The gateway starts and reports ready, but Slack and Telegram providers immediately crash with:

Cannot find package 'json5' imported from /Users/gizmo/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96/dist/frontmatter-Cc-V8aI2.js Did you mean to import "json5/lib/index.js"?

This happens even though json5 exists in the matching plugin-runtime-deps node_modules directory, and direct Node imports work.

OpenClaw version

2026.4.29

Operating system

MacOS

Install method

npm global

Model

N/A — channel provider startup fails before model invocation

Provider / routing chain

N/A — channel provider startup fails before provider/model routing

Additional provider/model setup details

Not model/provider-specific. Slack and Telegram channel providers fail during startup before any model request is made.

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The issue can be resolved by patching the provider startup to resolve dependencies from the correct plugin-runtime-deps/<version-hash>/node_modules directory or by bundling/Inlining json5 into the channel provider runtime.

Guidance

  • Verify that the json5 package exists in the expected location: ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96/node_modules/json5.
  • Check the NODE_PATH environment variable to ensure it includes the correct node_modules directory.
  • Consider modifying the provider launcher to use the same module resolution context, loader, and cwd as direct Node execution.
  • As a temporary workaround, try bundling or inlining json5 into the channel provider runtime to avoid the module resolution issue.

Example

No code example is provided as the issue requires a modification to the OpenClaw provider startup code, which is not explicitly shown in the issue.

Notes

The issue seems to be related to the module resolution context used by the provider launcher, which differs from the direct Node execution context. The solution will likely involve modifying the provider startup code to use the correct module resolution context.

Recommendation

Apply a workaround by bundling or inlining json5 into the channel provider runtime, as this seems to be a more feasible solution given the current information.

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

After bundled runtime deps are staged/installed and the gateway restarts, Slack and Telegram providers should start successfully.

The providers should resolve json5 from:

~/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96/node_modules/json5

Slack should reach socket mode connection, and Telegram providers should proceed past startup/getMe without crashing on module resolution.

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 - ✅(Solved) Fix [Bug]: Slack/Telegram providers fail to resolve json5 from plugin-runtime-deps despite json5 being installed [2 pull requests, 5 comments, 5 participants]