{"record":{"id":"bf8bf0038f589a3d","repo":"denoland/deno","slug":"import-map-not-found-in-eszip","errorCode":null,"errorMessage":"Import map not found in eszip: {}","messagePattern":"Import map not found in eszip: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/module_loader.rs","lineNumber":2278,"sourceCode":"      for specifier in specifiers {\n        let module = loaded_eszip.get_module(&specifier).unwrap();\n        let source = module.take_source().await.unwrap();\n        let resolved_specifier = resolve_url_or_path(&specifier, cwd)?;\n        let prev = loader.files.insert(resolved_specifier, source);\n        assert!(prev.is_none());\n      }\n    }\n\n    Ok(loader)\n  }\n\n  pub fn load_import_map_value(\n    &self,\n    specifier: &ModuleSpecifier,\n  ) -> Result<serde_json::Value, AnyError> {\n    match self.files.get(specifier) {\n      Some(bytes) => Ok(serde_json::from_slice(bytes.as_ref())?),\n      None => bail!(\"Import map not found in eszip: {}\", specifier),\n    }\n  }\n\n  fn load(&self, specifier: &ModuleSpecifier) -> deno_core::ModuleLoadResponse {\n    match self.files.get(specifier) {\n      Some(source) => {\n        let module_source = ModuleSource::new(\n          ModuleType::JavaScript,\n          ModuleSourceCode::Bytes(deno_core::ModuleCodeBytes::Arc(\n            source.clone(),\n          )),\n          specifier,\n          None,\n        );\n        deno_core::ModuleLoadResponse::Sync(Ok(module_source))\n      }\n      None => deno_core::ModuleLoadResponse::Sync(Err(JsErrorBox::generic(\n        \"Module not found\",","sourceCodeStart":2260,"sourceCodeEnd":2296,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/module_loader.rs#L2260-L2296","documentation":"A standalone binary produced by deno compile carries its modules in an eszip archive. When it needs the import map at runtime, it looks the import map's specifier up in that archive; a missing entry bails with \"Import map not found in eszip\" plus the specifier it wanted.","triggerScenarios":"Running a compiled binary whose eszip lacks the import map entry - typically a binary compiled before the import map was recorded, compiled from a different config/import-map state, or whose recorded import-map specifier no longer matches.","commonSituations":"Old CI artifacts executed after the project's import map moved or was renamed; recompiling with a different config than the one used originally; Deno version changes in how the import-map specifier is recorded.","solutions":["Recompile the binary with a current Deno from the same project state so the import map is embedded in the eszip","Keep imports in the deno.json used at compile time so they are captured deterministically","If the import map must stay external, ship it next to the binary and load it at runtime instead of expecting it inside the eszip"],"exampleFix":"# before\n# binary compiled earlier, then import map changed:\n./app  # Import map not found in eszip: file://.../import.map.json\n\n# after\n# recompile from the current project so the map is embedded\ndeno compile --output app main.ts","handlingStrategy":"fallback","validationCode":"// Smoke-test the compiled binary as part of the build\nconst cmd = new Deno.Command(\"./app\", { args: [\"--version\"], stderr: \"piped\" });\nconst { stderr } = await cmd.output();\nif (new TextDecoder().decode(stderr).includes(\"Import map not found in eszip\")) {\n  throw new Error(\"import map missing from eszip - recompile from current config\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runCompiledBinary(args);\n} catch (e) {\n  if (String(e).includes(\"Import map not found in eszip\")) {\n    // fallback: recompile the binary from the current project state, then retry\n    await recompile();\n    await runCompiledBinary(args);\n  } else {\n    throw e;\n  }\n}","preventionTips":["Recompile standalone binaries whenever the import map or deno.json changes","Treat the binary and its config as one artifact: rebuild both in the same CI step","Smoke-test each compiled binary (one real run) before shipping it"],"tags":["deno-compile","eszip","import-map","standalone-binary"],"backgroundTag":"missing-bundled-resource","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}