openclaw - 💡(How to fix) Fix `openclaw update` can fail with missing `dist` chunk after stale ACPX dependency leaves build output incomplete [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

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#70217Fetched 2026-04-23 07:27:39
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Timeline (top)
closed ×1commented ×1

openclaw update failed at CLI startup with ERR_MODULE_NOT_FOUND because the local dist/ tree had been cleaned and only partially rebuilt.

The underlying cause was a stale installed acpx package version in node_modules that no longer matched extensions/acpx/package.json or pnpm-lock.yaml.

Error Message

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/ge-admin/openclaw/dist/is-main-Bv5ej4lF.js' imported from /home/ge-admin/openclaw/dist/entry.js During rebuild, this caused pnpm build to fail in the ACPX extension with a resolution error from extensions/acpx/src/runtime.ts:

  • the surfaced error is instead a low-level missing hashed chunk under dist/
  1. Detect incomplete root CLI build output before startup and fail with a targeted message instead of a raw missing-chunk import error.

Root Cause

The ACPX extension declared [email protected] in extensions/acpx/package.json, and the lockfile also resolved [email protected], but the installed package in node_modules/acpx was still 0.4.0.

That older installed version did not export acpx/runtime.

During rebuild, this caused pnpm build to fail in the ACPX extension with a resolution error from extensions/acpx/src/runtime.ts:

Could not resolve 'acpx/runtime' in extensions/acpx/src/runtime.ts
Package subpath is not defined by exports

Because the build pipeline had already cleaned dist/, the failed rebuild left the root CLI output incomplete. After that, openclaw update crashed on startup because dist/entry.js still referenced hashed chunk files that were no longer present.

Code Example

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/ge-admin/openclaw/dist/is-main-Bv5ej4lF.js' imported from /home/ge-admin/openclaw/dist/entry.js

---

Could not resolve 'acpx/runtime' in extensions/acpx/src/runtime.ts
Package subpath is not defined by exports

---

pnpm install --filter ./extensions/acpx
pnpm build
RAW_BUFFERClick to expand / collapse

Summary

openclaw update failed at CLI startup with ERR_MODULE_NOT_FOUND because the local dist/ tree had been cleaned and only partially rebuilt.

The underlying cause was a stale installed acpx package version in node_modules that no longer matched extensions/acpx/package.json or pnpm-lock.yaml.

Observed failure

Running openclaw update produced:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/ge-admin/openclaw/dist/is-main-Bv5ej4lF.js' imported from /home/ge-admin/openclaw/dist/entry.js

Node version at the time: v22.22.0.

Root cause

The ACPX extension declared [email protected] in extensions/acpx/package.json, and the lockfile also resolved [email protected], but the installed package in node_modules/acpx was still 0.4.0.

That older installed version did not export acpx/runtime.

During rebuild, this caused pnpm build to fail in the ACPX extension with a resolution error from extensions/acpx/src/runtime.ts:

Could not resolve 'acpx/runtime' in extensions/acpx/src/runtime.ts
Package subpath is not defined by exports

Because the build pipeline had already cleaned dist/, the failed rebuild left the root CLI output incomplete. After that, openclaw update crashed on startup because dist/entry.js still referenced hashed chunk files that were no longer present.

Failure chain

  1. Installed dependency state drifted from the lockfile/package manifest.
  2. [email protected] remained in node_modules.
  3. pnpm build failed when ACPX code imported acpx/runtime.
  4. dist/ had already been cleaned, so the failed build left root CLI artifacts incomplete.
  5. openclaw update attempted to start from the broken local CLI bundle and failed with ERR_MODULE_NOT_FOUND on a missing hashed chunk.

Recovery that worked

A targeted reinstall followed by rebuild restored the CLI:

pnpm install --filter ./extensions/acpx
pnpm build

After that:

  • node -e "import('./dist/entry.js')" succeeded
  • openclaw update started normally again

Why this matters

The immediate dependency mismatch is local-state drift, but the user-facing failure mode is poor:

  • the actual actionable problem is an out-of-sync install / failed build
  • the surfaced error is instead a low-level missing hashed chunk under dist/
  • the updater gives no direct hint that the local build output is incomplete or that ACPX/package reinstall may be required

Suggested follow-ups

Any of these would improve the experience:

  1. Detect incomplete root CLI build output before startup and fail with a targeted message instead of a raw missing-chunk import error.
  2. Add a doctor or updater preflight that can detect manifest/lockfile vs installed-package drift for bundled plugin runtime dependencies.
  3. Make the updater surface rebuild guidance when local dist/entry.js or required sibling chunks are missing.
  4. Consider a more atomic build/update flow so a failed rebuild does not strand the repo in a half-built CLI state.

Local verification details

Checked during triage:

  • extensions/acpx/package.json expected [email protected]
  • pnpm-lock.yaml also resolved [email protected]
  • installed node_modules/acpx/package.json was 0.4.0 before reinstall
  • 0.4.0 exports did not include ./runtime
  • 0.5.3 exports do include ./runtime

Scope note

This issue is not claiming the ACPX source import is wrong. The import is valid for the declared package version. The bug is the operational failure mode when the installed dependency graph is stale and a failed rebuild leaves dist/ unusable.

extent analysis

TL;DR

Reinstall the acpx package and rebuild the project to resolve the ERR_MODULE_NOT_FOUND error caused by a stale installed package version.

Guidance

  • Verify that the installed acpx package version matches the version declared in extensions/acpx/package.json and pnpm-lock.yaml.
  • Run pnpm install --filter./extensions/acpx to reinstall the acpx package.
  • Run pnpm build to rebuild the project and restore the CLI.
  • Consider implementing a preflight check to detect incomplete root CLI build output or manifest/lockfile vs installed-package drift for bundled plugin runtime dependencies.

Example

pnpm install --filter./extensions/acpx
pnpm build

This command sequence reinstalls the acpx package and rebuilds the project, which should resolve the ERR_MODULE_NOT_FOUND error.

Notes

The issue is caused by a stale installed acpx package version, which can be resolved by reinstalling the package and rebuilding the project. However, to prevent similar issues in the future, it's recommended to implement a preflight check to detect incomplete root CLI build output or manifest/lockfile vs installed-package drift.

Recommendation

Apply the workaround by reinstalling the acpx package and rebuilding the project, as this should resolve the immediate issue. Additionally, consider implementing a preflight check to detect potential issues and prevent similar errors in the future.

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 `openclaw update` can fail with missing `dist` chunk after stale ACPX dependency leaves build output incomplete [1 comments, 2 participants]