openclaw - 💡(How to fix) Fix ws 8.21.0 breaks Discord gateway WebSocket under Node 22

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…

OpenClaw 5.27 ships with ws 8.21.0, which breaks Discord gateway WebSocket connectivity under Node 22. OpenClaw 5.7 with ws 8.20.0 works fine.

Root Cause

OpenClaw 5.27 ships with ws 8.21.0, which breaks Discord gateway WebSocket connectivity under Node 22. OpenClaw 5.7 with ws 8.20.0 works fine.

Fix Action

Workaround

Downgrade ws to 8.20.0:

npm install [email protected]

Code Example

npm install ws@8.20.0
RAW_BUFFERClick to expand / collapse

Summary

OpenClaw 5.27 ships with ws 8.21.0, which breaks Discord gateway WebSocket connectivity under Node 22. OpenClaw 5.7 with ws 8.20.0 works fine.

Details

ws 8.21.0 introduced maxBufferedChunks / maxFragments checks in Receiver._write. This change breaks the Writable stream callback flow for the Discord gateway WebSocket when running under Node 22.

Symptoms:

  • Discord WebSocket connection fails or becomes unstable
  • Gateway messages are not processed correctly

What works:

  • OpenClaw 5.7 with ws 8.20.0 — no issues
  • Downgrading ws to 8.20.0 in OpenClaw 5.27 — resolves the problem

Reproduction

  1. Install OpenClaw 5.27 (which pulls in ws 8.21.0)
  2. Run under Node 22
  3. Observe Discord WebSocket connectivity failures

Workaround

Downgrade ws to 8.20.0:

npm install [email protected]

Suggestion

  • Pin ws to 8.20.0 in OpenClaw's dependencies until the regression is resolved
  • Consider filing an upstream issue with the ws maintainers about the maxBufferedChunks/maxFragments changes in Receiver._write breaking the Writable stream callback flow under Node 22

Environment

  • OpenClaw: 5.27 (broken), 5.7 (works)
  • ws: 8.21.0 (broken), 8.20.0 (works)
  • Node.js: 22
  • Affected integration: Discord gateway WebSocket

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