openclaw - 💡(How to fix) Fix [telegram] babel.cjs register-race on startup with multiple accounts [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#75903Fetched 2026-05-03 04:44:29
View on GitHub
Comments
2
Participants
3
Timeline
6
Reactions
2
Timeline (top)
commented ×2cross-referenced ×2closed ×1unsubscribed ×1

Fix Action

Fix / Workaround

Workaround applied locally

None — recovery is automatic, but warnings persist on every restart.

Code Example

[telegram] register failed: Cannot find module '.../<some-path>/register/babel.cjs'
RAW_BUFFERClick to expand / collapse

[telegram] babel.cjs register-race during plugin bootstrap

Environment

  • openclaw 2026.4.29
  • Telegram channel plugin (built-in), 5 accounts in channels.telegram.accounts
  • Linux 6.17, Node.js (system)

Symptom

On startup the Telegram plugin emits twice (within ~200 ms of each other):

[telegram] register failed: Cannot find module '.../<some-path>/register/babel.cjs'

After the second failure the plugin still recovers (long-poll loop comes up), but:

  1. Two transient errors fire before recovery — confusing during log triage.
  2. The race appears tied to which import path resolves first when multiple accounts are registered concurrently in the same tick.

Hypothesis

  • Plugin parallelizes account registration via Promise.all.
  • Each branch tries to require(... babel/register/babel.cjs ...) against a shared lazy-loader that hasn't completed initial install yet.
  • First branch wins the install, the others see a half-written node_modules tree → MODULE_NOT_FOUND.

Proposed fix

  • Serialize the first register call; once the loader is warm, fan out remaining accounts.
  • Or pre-warm the require during plugin init (before any account binding) and let account loops assume the module is present.

Workaround applied locally

None — recovery is automatic, but warnings persist on every restart.

Repro

  1. Configure ≥3 Telegram accounts in channels.telegram.accounts.
  2. Restart the gateway with a fresh dist/ (e.g., right after bundled-deps install).
  3. Observe two [telegram] register failed: Cannot find module ... register/babel.cjs entries within the first ~300 ms of telegram plugin init.

extent analysis

TL;DR

Serialize the first register call to ensure the loader is warm before fanning out remaining accounts to prevent the MODULE_NOT_FOUND error.

Guidance

  • Verify the hypothesis by checking if the error occurs when multiple accounts are registered concurrently and if the error disappears when registration is serialized.
  • Implement a serialization mechanism for the first register call, allowing the loader to complete its initial install before proceeding with the remaining accounts.
  • Consider pre-warming the require during plugin init to ensure the module is present before account loops begin.
  • Test the proposed fix by reproducing the issue with ≥3 Telegram accounts configured and verifying that the error no longer occurs.

Example

// Pseudo-code example of serializing the first register call
const serializeRegister = async (accounts) => {
  // Warm up the loader with the first account
  await registerAccount(accounts[0]);
  // Fan out remaining accounts
  await Promise.all(accounts.slice(1).map(registerAccount));
};

Notes

The proposed fix assumes that the issue is indeed caused by the parallelization of account registration and the shared lazy-loader. Further testing and verification are necessary to confirm this hypothesis.

Recommendation

Apply the workaround by serializing the first register call to prevent the MODULE_NOT_FOUND error, as this approach directly addresses the suspected root cause of the issue.

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