openclaw - 💡(How to fix) Fix Matrix crypto bootstrap fails: createRequire uses .ts extension in dist bundle [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#59380Fetched 2026-04-08 02:24:30
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
closed ×1commented ×1locked ×1subscribed ×1

The Matrix plugin's crypto bootstrap runtime fails on startup with:

[plugins] matrix: failed loading crypto bootstrap runtime: Cannot find module './plugin-entry.runtime.ts'

Root Cause

In dist/plugin-entry.runtime-BKy-grFo.js, line 82:

})("./plugin-entry.runtime.ts");

This passes a .ts extension to createRequire(), but only .js files exist in the dist folder:

  • plugin-entry.runtime.js (stub that re-exports from the hashed file)
  • plugin-entry.runtime-BKy-grFo.js (actual implementation)

The .ts source filename was not rewritten to .js during bundling.

Fix Action

Fix / Workaround

Attempted Workaround

Code Example

[plugins] matrix: failed loading crypto bootstrap runtime: Cannot find module './plugin-entry.runtime.ts'

---

})("./plugin-entry.runtime.ts");
RAW_BUFFERClick to expand / collapse

Description

The Matrix plugin's crypto bootstrap runtime fails on startup with:

[plugins] matrix: failed loading crypto bootstrap runtime: Cannot find module './plugin-entry.runtime.ts'

Root Cause

In dist/plugin-entry.runtime-BKy-grFo.js, line 82:

})("./plugin-entry.runtime.ts");

This passes a .ts extension to createRequire(), but only .js files exist in the dist folder:

  • plugin-entry.runtime.js (stub that re-exports from the hashed file)
  • plugin-entry.runtime-BKy-grFo.js (actual implementation)

The .ts source filename was not rewritten to .js during bundling.

Attempted Workaround

Symlinking .ts → .js causes Maximum call stack size exceeded because:

  1. .ts symlink → plugin-entry.runtime.js (stub)
  2. Stub re-exports from plugin-entry.runtime-BKy-grFo.js
  3. That file calls createRequire('./plugin-entry.runtime.ts') again → infinite loop

Symlinking .ts directly to the hashed file also causes stack overflow.

Impact

  • E2EE bootstrap fails — encrypted room history before current session cannot be decrypted
  • Unencrypted messaging and new message exchange still works
  • Affects OpenClaw 2026.4.1 (da64a97) on macOS arm64, Node v25.8.2

Expected Fix

The bundler should rewrite the createRequire() argument from .ts to .js in the dist output.

Environment

  • OpenClaw: 2026.4.1 (da64a97)
  • OS: macOS 26.3 (arm64)
  • Node: v25.8.2
  • Matrix homeserver: Synapse on Ubuntu 24.04

extent analysis

TL;DR

The most likely fix is to configure the bundler to rewrite the createRequire() argument from .ts to .js in the dist output.

Guidance

  • Verify that the bundler configuration is set up to handle TypeScript files correctly and rewrite the file extensions as needed.
  • Check the createRequire() function calls in the code to ensure they are using the correct file extensions.
  • Consider updating the bundler or its configuration to support rewriting file extensions in the dist output.
  • Test the fix by checking if the crypto bootstrap runtime loads successfully after applying the changes.

Example

No code snippet is provided as the issue is related to the bundler configuration and not a specific code snippet.

Notes

The fix may require updates to the bundler configuration or the build process, and may not be a simple code change. The issue is specific to the OpenClaw 2026.4.1 version and Node v25.8.2, so the fix may not apply to other versions.

Recommendation

Apply a workaround by manually rewriting the createRequire() argument from .ts to .js in the dist output, as updating the bundler configuration may not be feasible. This will allow the crypto bootstrap runtime to load successfully until a permanent fix is available.

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 Matrix crypto bootstrap fails: createRequire uses .ts extension in dist bundle [1 comments, 2 participants]