{"record":{"id":"4dd35befb986068a","repo":"pydantic/monty","slug":"component-core-module-is-missing-path","errorCode":null,"errorMessage":"component core module is missing: ${path}","messagePattern":"component core module is missing: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/monty-js/ts/worker/host.ts","lineNumber":76,"sourceCode":"    'wasi:clocks/monotonic-clock': imports['wasi:clocks/monotonic-clock'],\n    'wasi:clocks/wall-clock': imports['wasi:clocks/wall-clock'],\n    'wasi:filesystem/preopens': imports['wasi:filesystem/preopens'],\n    'wasi:filesystem/types': imports['wasi:filesystem/types'],\n    'wasi:io/error': imports['wasi:io/error'],\n    'wasi:io/streams': imports['wasi:io/streams'],\n    'wasi:random/random': imports['wasi:random/random'],\n  }\n}\n\n/** Turns a guest exit into a component failure instead of terminating Node. */\nfunction denyProcessExit(): never {\n  throw new Error('Monty wasm component requested process exit')\n}\n\n/** Resolves Jco's relative core-module path against the precompiled module map. */\nfunction getModule(modules: ComponentModules, path: string): WebAssembly.Module {\n  const module = modules[path] ?? modules[path.replace(/^\\.\\//, '')]\n  if (!module) throw new Error(`component core module is missing: ${path}`)\n  return module\n}\n","sourceCodeStart":58,"sourceCodeEnd":79,"githubUrl":"https://github.com/pydantic/monty/blob/adc986b362e3961f407868cb118a99fe831b9e61/crates/monty-js/ts/worker/host.ts#L58-L79","documentation":"When instantiating the Jco-compiled wasm component, each core module referenced by the component's relative path must be present in the precompiled module map. getModule throws this Error when the lookup (with and without a leading './') finds nothing, meaning the build's module map is incomplete or mismatched with the generated component.","triggerScenarios":"Using the wasm worker path where the ComponentModules map passed to the host was built from a different component version than the checked-in/generated component imports; a path like './monty.core.wasm' missing from the map.","commonSituations":"Stale build artifacts after `make build-wasm` was skipped or partially run; version skew between the published @pydantic/monty/wasm TS layer and bundled component; custom bundling that renamed or dropped core modules.","solutions":["Rebuild the wasm component with `make build-wasm` so the module map and component are regenerated together","Check the quoted path in the message against the keys of your modules map and fix the mapping/bundling","Ensure the installed @pydantic/monty package versions are consistent (no mixed versions of the wasm entry point)","If bundling yourself, keep Jco's relative core-module paths intact"],"exampleFix":"// before\nconst modules = { 'monty.core.wasm': core } // missing './' variant expected by component\n// after\nconst modules = { './monty.core.wasm': core, 'monty.core.wasm': core }","handlingStrategy":"try-catch","validationCode":"for (const p of expectedCoreModulePaths) { if (!modules[p] && !modules[p.replace(/^\\.\\//, '')]) throw new Error(`missing core module: ${p}`) }","typeGuard":"null","tryCatchPattern":"try { const comp = component(modules, imports) } catch (e) { if (e.message.startsWith('component core module is missing')) throw new Error('stale wasm build — rerun make build-wasm') ; throw e }","preventionTips":["Run `make build-wasm` after updating monty or the TS wasm layer so the module map regenerates with the component","Never hand-edit or rename Jco-generated core-module paths in your bundler","Pin all @pydantic/monty packages to the same version","Log the modules map keys when instantiation fails to spot mismatches quickly"],"tags":["wasm","wasm-bindgen","module-loading","build"],"backgroundTag":"missing-dependency","analyzedSha":"adc986b362e3961f407868cb118a99fe831b9e61","analyzedAt":"2026-09-13T19:19:18.698Z","contentChangedAt":"2026-09-13T19:19:18.698Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}