Module Hash Mismatch After npm install β sessions_send and web_fetch Broken
Internal module references point to outdated hashed filenames after npm install, causing ERR_MODULE_NOT_FOUND errors for sessions_send and web_fetch operations.
π Symptoms
Primary Error Manifestations
After running npm install in the OpenClaw directory, internal module resolution fails with the following error patterns:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '...\dist\manager-DzRWrKSA.js'
at Module._resolveFilename (node:internal/modules/esm/resolve:182:9)
at Module._resolveFilename (node:internal/modules/esm/resolve:186:7)
at checkResolverForUnmappedModule (...\manager.js:142:17)
at sessions_send_handler (...\sessions.js:78:12)Error [ERR_MODULE_NOT_FOUND]: Cannot find module '...\dist\runtime-CeGN4XUC.js'
at Module._resolveFilename (node:internal/modules/esm/resolve:182:9)
at Module._resolveFilename (node:internal/modules/esm/resolve:186:7)
at web_fetch_handler (...\webtools.js:67:12)Affected Operations
| Operation | Error Code | Failure Point |
|---|---|---|
sessions_send | ERR_MODULE_NOT_FOUND | sessions.js:78 β checkResolverForUnmappedModule |
web_fetch | ERR_MODULE_NOT_FOUND | webtools.js:67 β fetchRuntime.resolve() |
telegram_bot | ERR_MODULE_NOT_FOUND | Dependent on sessions_send |
http_server | ENOTDIR | Module manifest points to non-existent paths |
Diagnostic Command Output
$ node --version
v22.14.0
$ npm ls openclaw
βββ openclaw@2026.5.6
$ ls dist/
manager-A1b2C3d4.js # β Old hash still referenced
runtime-E5f6G7h8.js # β Old hash still referenced
core-I9j0K1l2.js # β Old hash still referenced
# Expected (actual) filenames after rebuild:
manager-X9y8Z7w6.js # β New hash from npm install
runtime-K3m2N5p8.js # β New hash from npm installVersion-Specific Trigger
This regression appears after:
- Running
npm installwith dependency updates - Platform-cross compilation triggers hash regeneration
- Any build pipeline that modifies
dist/contents
π§ Root Cause
Architectural Analysis
OpenClaw uses content-based hashing for compiled JavaScript modules to enable long-term caching. The build system generates filenames like [module-name]-[content-hash].js and stores a manifest mapping logical module names to hashed filenames.
Failure Sequence
Stage 1: Normal Operation (Pre-npm install)