openclaw - ✅(Solved) Fix Telegram channel crash-loops on 2026.4.5: missing grammy runtime dependencies in published npm package [1 pull requests, 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#62425Fetched 2026-04-08 03:04:26
View on GitHub
Comments
2
Participants
3
Timeline
4
Reactions
0
Timeline (top)
commented ×2cross-referenced ×1referenced ×1

After updating to [email protected] (from 2026.3.8), the Telegram channel crash-loops on startup with:

[default] channel exited: Cannot find package '@grammyjs/runner' imported from /usr/lib/node_modules/openclaw/dist/monitor-polling.runtime-Aoz3uawl.js

After manually installing @grammyjs/runner, the next restart fails with:

[default] channel exited: Cannot find package '@grammyjs/transformer-throttler' imported from /usr/lib/node_modules/openclaw/dist/bot-DYFDqLWF.js

Root Cause

The published npm tarball for [email protected] does not declare any grammy ecosystem packages in its dependencies, even though the bundled dist/ code imports them at runtime.

Reproduction (no install needed):

mkdir /tmp/openclaw-repro && cd /tmp/openclaw-repro
npm pack [email protected]
tar -xzf openclaw-2026.4.5.tgz

# Published deps: zero grammy packages
jq '.dependencies | keys[] | select(. | test("grammy"))' package/package.json
# (no output)

# But dist/ imports three of them
grep -rEo '@grammyjs/[a-z-]+' package/dist | sort -u
# @grammyjs/runner
# @grammyjs/transformer-throttler
# @grammyjs/types

For comparison, the source package.json (verified by inspecting an installed copy from a previous version, and presumably what's in the repo) does declare:

"@grammyjs/runner": "^2.0.3",
"@grammyjs/transformer-throttler": "^1.2.1"

So the deps are declared in source but stripped from the published tarball. My guess is scripts/openclaw-prepack.ts (run as the prepack script) is removing them, possibly intending to externalize them via the bundler but missing these specific ones.

It's also worth checking grammy itself — I didn't see it in the published dependencies either, so the same fix likely needs to keep it.

Fix Action

Workaround

Install the missing packages into openclaw's own node_modules:

cd /usr/lib/node_modules/openclaw
npm install --save @grammyjs/runner @grammyjs/transformer-throttler
openclaw gateway restart

(npm install for both at once — installing them one at a time wipes the previous one.)

PR fix notes

PR #2: fix(telegram): add missing grammy runtime dependencies

Description (problem / solution / changelog)

Problem

Resolves #62425.

The openclaw npm package (v2026.4.5) was missing three grammy runtime dependencies in package.json. During development they are resolved from the pnpm workspace, so builds and tests pass. But in a clean global npm install openclaw the Telegram channel crashes immediately on startup with:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@grammyjs/runner'

The same applies to grammy itself and @grammyjs/transformer-throttler.

@grammyjs/types was also in devDependencies only, but is used at runtime (e.g. GrammyError instanceof checks and type-narrowing in the running process).

Changes

Added to dependencies:

PackageVersionWhy
grammy^1.36.0Core bot framework, directly imported at runtime
@grammyjs/runner^2.0.3Long-polling runner used by the Telegram plugin
@grammyjs/transformer-throttler^1.2.1Rate-limit transformer applied in bot setup
@grammyjs/types^3.25.0Moved from devDependencies — inspected at runtime

Testing

  • npm pack and verify npm ls grammy @grammyjs/runner @grammyjs/transformer-throttler resolves correctly on a clean install
  • Telegram channel starts without ERR_MODULE_NOT_FOUND

Changed files

  • package.json (modified, +4/-1)

Code Example

[default] channel exited: Cannot find package '@grammyjs/runner' imported from /usr/lib/node_modules/openclaw/dist/monitor-polling.runtime-Aoz3uawl.js

---

[default] channel exited: Cannot find package '@grammyjs/transformer-throttler' imported from /usr/lib/node_modules/openclaw/dist/bot-DYFDqLWF.js

---

mkdir /tmp/openclaw-repro && cd /tmp/openclaw-repro
npm pack openclaw@2026.4.5
tar -xzf openclaw-2026.4.5.tgz

# Published deps: zero grammy packages
jq '.dependencies | keys[] | select(. | test("grammy"))' package/package.json
# (no output)

# But dist/ imports three of them
grep -rEo '@grammyjs/[a-z-]+' package/dist | sort -u
# @grammyjs/runner
# @grammyjs/transformer-throttler
# @grammyjs/types

---

"@grammyjs/runner": "^2.0.3",
"@grammyjs/transformer-throttler": "^1.2.1"

---

cd /usr/lib/node_modules/openclaw
npm install --save @grammyjs/runner @grammyjs/transformer-throttler
openclaw gateway restart
RAW_BUFFERClick to expand / collapse

Summary

After updating to [email protected] (from 2026.3.8), the Telegram channel crash-loops on startup with:

[default] channel exited: Cannot find package '@grammyjs/runner' imported from /usr/lib/node_modules/openclaw/dist/monitor-polling.runtime-Aoz3uawl.js

After manually installing @grammyjs/runner, the next restart fails with:

[default] channel exited: Cannot find package '@grammyjs/transformer-throttler' imported from /usr/lib/node_modules/openclaw/dist/bot-DYFDqLWF.js

Root cause

The published npm tarball for [email protected] does not declare any grammy ecosystem packages in its dependencies, even though the bundled dist/ code imports them at runtime.

Reproduction (no install needed):

mkdir /tmp/openclaw-repro && cd /tmp/openclaw-repro
npm pack [email protected]
tar -xzf openclaw-2026.4.5.tgz

# Published deps: zero grammy packages
jq '.dependencies | keys[] | select(. | test("grammy"))' package/package.json
# (no output)

# But dist/ imports three of them
grep -rEo '@grammyjs/[a-z-]+' package/dist | sort -u
# @grammyjs/runner
# @grammyjs/transformer-throttler
# @grammyjs/types

For comparison, the source package.json (verified by inspecting an installed copy from a previous version, and presumably what's in the repo) does declare:

"@grammyjs/runner": "^2.0.3",
"@grammyjs/transformer-throttler": "^1.2.1"

So the deps are declared in source but stripped from the published tarball. My guess is scripts/openclaw-prepack.ts (run as the prepack script) is removing them, possibly intending to externalize them via the bundler but missing these specific ones.

It's also worth checking grammy itself — I didn't see it in the published dependencies either, so the same fix likely needs to keep it.

Workaround

Install the missing packages into openclaw's own node_modules:

cd /usr/lib/node_modules/openclaw
npm install --save @grammyjs/runner @grammyjs/transformer-throttler
openclaw gateway restart

(npm install for both at once — installing them one at a time wipes the previous one.)

Environment

  • openclaw 2026.4.5 (was working fine on 2026.3.8)
  • Ubuntu 24.04.3 LTS, Node 22.22.0
  • Global install via npm
  • Telegram channel only; this is the only channel that imports grammy

Suggested fix

Audit scripts/openclaw-prepack.ts (or wherever the published package.json is generated) to ensure runtime imports referenced from dist/ are not stripped from dependencies. A release:openclaw:npm:check step that greps dist/ for bare imports and verifies each one is in the published dependencies would catch this class of bug.

extent analysis

TL;DR

Install the missing @grammyjs packages into openclaw's node_modules to resolve the crash-loop issue.

Guidance

  • Verify that the @grammyjs/runner and @grammyjs/transformer-throttler packages are not declared in the published openclaw package.json by running jq '.dependencies | keys[] | select(. | test("grammy"))' package/package.json in the extracted openclaw package directory.
  • Install the missing packages using npm install --save @grammyjs/runner @grammyjs/transformer-throttler in the openclaw installation directory.
  • Restart the openclaw gateway after installing the missing packages.
  • Consider auditing the scripts/openclaw-prepack.ts script to ensure that runtime imports are not stripped from the published dependencies.

Example

cd /usr/lib/node_modules/openclaw
npm install --save @grammyjs/runner @grammyjs/transformer-throttler
openclaw gateway restart

Notes

This workaround may need to be reapplied if the openclaw package is updated or reinstalled. A permanent fix would require modifying the scripts/openclaw-prepack.ts script to include the missing dependencies.

Recommendation

Apply the workaround by installing the missing @grammyjs packages, as this is a quicker solution than auditing and modifying the scripts/openclaw-prepack.ts script.

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