openclaw - 💡(How to fix) Fix 2026.3.31 package layout regression: shared dist chunks import plugin-local deps that are incomplete at top-level node_modules [3 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#59081Fetched 2026-04-08 02:28:54
View on GitHub
Comments
3
Participants
3
Timeline
3
Reactions
4
Timeline (top)
commented ×3

Error Message

[plugins] amazon-bedrock failed to load from /tmp/openclaw331-inspect/node_modules/openclaw/dist/extensions/amazon-bedrock/index.js: Error: Cannot find module '@aws-sdk/client-bedrock' Require stack:

  • /tmp/openclaw331-inspect/node_modules/openclaw/dist/discovery-Bwev8dJL.js

[openclaw] Failed to start CLI: PluginLoadFailureError: plugin load failed: amazon-bedrock: Error: Cannot find module '@aws-sdk/client-bedrock'

Root Cause

I first hit this in a custom pinned-vendor Discord deployment, but I was able to reproduce it from a plain fresh npm install [email protected], so this does not appear to be caused by my local promote/deploy script.

Fix Action

Temporary workaround

I rolled production back to 2026.3.24, which immediately restored normal behavior.

Code Example

rm -rf /tmp/openclaw331-inspect
mkdir -p /tmp/openclaw331-inspect
npm install --prefix /tmp/openclaw331-inspect openclaw@2026.3.31

HOME=/tmp/openclaw331-empty-home \
/usr/bin/node /tmp/openclaw331-inspect/node_modules/openclaw/openclaw.mjs channels status --probe --json

---

[plugins] amazon-bedrock failed to load from /tmp/openclaw331-inspect/node_modules/openclaw/dist/extensions/amazon-bedrock/index.js: Error: Cannot find module '@aws-sdk/client-bedrock'
Require stack:
- /tmp/openclaw331-inspect/node_modules/openclaw/dist/discovery-Bwev8dJL.js

[openclaw] Failed to start CLI: PluginLoadFailureError: plugin load failed: amazon-bedrock: Error: Cannot find module '@aws-sdk/client-bedrock'

---

discord failed to load ... Cannot find module '@buape/carbon'

---

dist/ui-DKBKDxGo.js
7: import { Container } from "@buape/carbon";

dist/discovery-Bwev8dJL.js
5: import { BedrockClient, ListFoundationModelsCommand } from "@aws-sdk/client-bedrock";

---

dist/extensions/discord/index.js
20: import { ... } from "../../ui-DKBKDxGo.js";
29: import { Separator, TextDisplay } from "@buape/carbon";

dist/extensions/amazon-bedrock/index.js
4: import { ... } from "../../discovery-Bwev8dJL.js";

---

top_aws=no
top_carbon=no
ext_aws=yes
ext_carbon=yes

---

npm install openclaw@2026.3.31
RAW_BUFFERClick to expand / collapse

Summary

OpenClaw 2026.3.31 appears to have a packaging/layout regression.

Some top-level shared dist/*.js chunks import dependencies such as:

  • @buape/carbon
  • @aws-sdk/client-bedrock

But in the published 2026.3.31 package, those dependencies are only complete inside extension-local paths such as:

  • dist/extensions/discord/node_modules/@buape/carbon
  • dist/extensions/amazon-bedrock/node_modules/@aws-sdk/client-bedrock

At the package top level, the corresponding directories exist but are incomplete and missing package.json, so Node cannot resolve them when they are imported from top-level shared chunks.

This breaks plugin loading. In my case:

  • Discord fails with Cannot find module '@buape/carbon'
  • amazon-bedrock fails with Cannot find module '@aws-sdk/client-bedrock'

I first hit this in a custom pinned-vendor Discord deployment, but I was able to reproduce it from a plain fresh npm install [email protected], so this does not appear to be caused by my local promote/deploy script.

Affected version

  • OpenClaw 2026.3.31 (213a704)

Last known good version

  • OpenClaw 2026.3.24 (cff6dc9)

Environment

  • OS: Ubuntu 24.04.3 LTS
  • Kernel: Linux 6.6.87.2-microsoft-standard-WSL2 x86_64
  • Node: v24.13.0

Minimal reproduction

rm -rf /tmp/openclaw331-inspect
mkdir -p /tmp/openclaw331-inspect
npm install --prefix /tmp/openclaw331-inspect [email protected]

HOME=/tmp/openclaw331-empty-home \
/usr/bin/node /tmp/openclaw331-inspect/node_modules/openclaw/openclaw.mjs channels status --probe --json

Actual result

The command fails during plugin loading with:

[plugins] amazon-bedrock failed to load from /tmp/openclaw331-inspect/node_modules/openclaw/dist/extensions/amazon-bedrock/index.js: Error: Cannot find module '@aws-sdk/client-bedrock'
Require stack:
- /tmp/openclaw331-inspect/node_modules/openclaw/dist/discovery-Bwev8dJL.js

[openclaw] Failed to start CLI: PluginLoadFailureError: plugin load failed: amazon-bedrock: Error: Cannot find module '@aws-sdk/client-bedrock'

In my production deployment I also saw:

discord failed to load ... Cannot find module '@buape/carbon'

Expected result

channels status --probe --json should start normally and not fail due to plugin packaging/layout issues.

Additional evidence

1. Top-level shared chunks import these packages

In 2026.3.31:

dist/ui-DKBKDxGo.js
7: import { Container } from "@buape/carbon";

dist/discovery-Bwev8dJL.js
5: import { BedrockClient, ListFoundationModelsCommand } from "@aws-sdk/client-bedrock";

And extension entrypoints import those shared chunks:

dist/extensions/discord/index.js
20: import { ... } from "../../ui-DKBKDxGo.js";
29: import { Separator, TextDisplay } from "@buape/carbon";

dist/extensions/amazon-bedrock/index.js
4: import { ... } from "../../discovery-Bwev8dJL.js";

2. The extension-local copies are complete, but the top-level copies are incomplete

From the installed 2026.3.31 package:

top_aws=no
top_carbon=no
ext_aws=yes
ext_carbon=yes

Meaning:

  • node_modules/@aws-sdk/client-bedrock/package.json => missing
  • node_modules/@buape/carbon/package.json => missing
  • dist/extensions/amazon-bedrock/node_modules/@aws-sdk/client-bedrock/package.json => present
  • dist/extensions/discord/node_modules/@buape/carbon/package.json => present

I also inspected the top-level directories directly:

  • node_modules/@aws-sdk/client-bedrock/ exists but is missing package.json
  • node_modules/@buape/carbon/ exists but is missing package.json

So this is not just "dependency absent"; it looks like the published package contains incomplete top-level dependency directories.

3. This does not appear to be caused by a custom promote/copy script

I first saw the bug in a custom pinned-vendor deployment, but I reproduced the same structure and the same crash from a fresh:

npm install [email protected]

So the issue appears to be in the published package or packaging pipeline itself, not in local deployment logic.

Likely root cause

My current hypothesis is:

  1. 2026.3.31 introduced shared top-level chunks that directly import extension-related dependencies.
  2. Those dependencies are only fully packaged under extension-local dist/extensions/*/node_modules.
  3. The top-level node_modules contains incomplete directories for the same packages.
  4. When Node resolves imports from top-level dist/*.js, it fails because the top-level package metadata is incomplete or missing.

Temporary workaround

I rolled production back to 2026.3.24, which immediately restored normal behavior.

Impact

This blocks upgrading a working Discord/OpenClaw deployment from 2026.3.24 to 2026.3.31.

Because the failure is reproducible from a plain fresh install, it may affect other Linux/WSL users even without custom deployment tooling.

extent analysis

TL;DR

The most likely fix is to ensure that the top-level node_modules directory contains complete packages, including package.json files, for all dependencies imported by top-level shared chunks.

Guidance

  • Verify that the packaging pipeline for OpenClaw includes all necessary dependencies in the top-level node_modules directory.
  • Check the npm install or build process to ensure that it correctly installs and packages all dependencies, including @buape/carbon and @aws-sdk/client-bedrock.
  • Consider modifying the build or packaging process to include a step that verifies the completeness of the top-level node_modules directory.
  • As a temporary workaround, rolling back to OpenClaw 2026.3.24 may resolve the issue, but this does not address the underlying problem.

Example

No code snippet is provided as the issue is related to the packaging and deployment process rather than a specific code error.

Notes

The root cause of the issue appears to be related to the packaging pipeline or build process for OpenClaw, rather than a problem with the code itself. The fact that the issue can be reproduced with a plain fresh install suggests that the problem is not specific to the user's custom deployment tooling.

Recommendation

Apply the temporary workaround of rolling back to OpenClaw 2026.3.24 until the packaging issue can be resolved, as this will allow for a functional deployment while the underlying problem is addressed.

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

Temporary workaround

I rolled production back to 2026.3.24, which immediately restored normal behavior.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING