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
- Installed dependency state drifted from the lockfile/package manifest.
[email protected] remained in node_modules.
pnpm build failed when ACPX code imported acpx/runtime.
dist/ had already been cleaned, so the failed build left root CLI artifacts incomplete.
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:
- Detect incomplete root CLI build output before startup and fail with a targeted message instead of a raw missing-chunk import error.
- Add a doctor or updater preflight that can detect manifest/lockfile vs installed-package drift for bundled plugin runtime dependencies.
- Make the updater surface rebuild guidance when local
dist/entry.js or required sibling chunks are missing.
- 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.
Summary
openclaw updatefailed at CLI startup withERR_MODULE_NOT_FOUNDbecause the localdist/tree had been cleaned and only partially rebuilt.The underlying cause was a stale installed
acpxpackage version innode_modulesthat no longer matchedextensions/acpx/package.jsonorpnpm-lock.yaml.Observed failure
Running
openclaw updateproduced:Node version at the time:
v22.22.0.Root cause
The ACPX extension declared
[email protected]inextensions/acpx/package.json, and the lockfile also resolved[email protected], but the installed package innode_modules/acpxwas still0.4.0.That older installed version did not export
acpx/runtime.During rebuild, this caused
pnpm buildto fail in the ACPX extension with a resolution error fromextensions/acpx/src/runtime.ts:Because the build pipeline had already cleaned
dist/, the failed rebuild left the root CLI output incomplete. After that,openclaw updatecrashed on startup becausedist/entry.jsstill referenced hashed chunk files that were no longer present.Failure chain
[email protected]remained innode_modules.pnpm buildfailed when ACPX code importedacpx/runtime.dist/had already been cleaned, so the failed build left root CLI artifacts incomplete.openclaw updateattempted to start from the broken local CLI bundle and failed withERR_MODULE_NOT_FOUNDon a missing hashed chunk.Recovery that worked
A targeted reinstall followed by rebuild restored the CLI:
After that:
node -e "import('./dist/entry.js')"succeededopenclaw updatestarted normally againWhy this matters
The immediate dependency mismatch is local-state drift, but the user-facing failure mode is poor:
dist/Suggested follow-ups
Any of these would improve the experience:
dist/entry.jsor required sibling chunks are missing.Local verification details
Checked during triage:
extensions/acpx/package.jsonexpected[email protected]pnpm-lock.yamlalso resolved[email protected]node_modules/acpx/package.jsonwas0.4.0before reinstall0.4.0exports did not include./runtime0.5.3exports do include./runtimeScope 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.