{"record":{"id":"78e6ebb4a929eb3d","repo":"denoland/deno","slug":"module-not-found","errorCode":null,"errorMessage":"module not found {}","messagePattern":"module not found (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"libs/eszip/v2.rs","lineNumber":1367,"sourceCode":"    fn visit_module<'a>(\n      graph: &'a ModuleGraph,\n      module_kind_provider: &dyn ModuleKindResolver,\n      parser: CapturingEsParser,\n      transpile_options: &TranspileOptions,\n      emit_options: &EmitOptions,\n      modules: &mut LinkedHashMap<String, EszipV2Module>,\n      visited: ToVisit,\n      relative_file_base: Option<EszipRelativeFileBaseUrl>,\n      npm_packages: Option<&mut FromGraphNpmPackages>,\n      npm_snapshot: &ValidSerializedNpmResolutionSnapshot,\n    ) -> Result<\n      Option<Box<dyn DoubleEndedIterator<Item = ToVisit<'a>> + 'a>>,\n      anyhow::Error,\n    > {\n      let module = match graph.try_get(visited.specifier()) {\n        Ok(Some(module)) => module,\n        Ok(None) => {\n          return Err(anyhow::anyhow!(\n            \"module not found {}\",\n            visited.specifier()\n          ));\n        }\n        Err(err) => {\n          if visited.is_dynamic() {\n            // dynamic imports are allowed to fail\n            return Ok(None);\n          }\n          return Err(anyhow::anyhow!(\n            \"failed to load '{}': {}\",\n            visited.specifier(),\n            err\n          ));\n        }\n      };\n\n      let specifier_key =","sourceCodeStart":1349,"sourceCodeEnd":1385,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/libs/eszip/v2.rs#L1349-L1385","documentation":"While converting a deno_graph ModuleGraph into an eszip v2 archive, every queued specifier is looked up with graph.try_get. Ok(None) means the specifier was scheduled for visiting but no module for it exists in the graph — graph and visit set disagree — and eszip creation aborts.","triggerScenarios":"Calling eszip's from_graph with a graph built with different options, different entrypoints, or skipped resolution than the visit list implies (cached/partial graphs, custom resolvers dropping modules, npm resolution skipped).","commonSituations":"Tooling that reuses a previously built ModuleGraph; `deno compile`-style pipelines after version upgrades where deno_graph and eszip disagree; graphs created with skip flags or stub resolvers.","solutions":["Rebuild the ModuleGraph from the same entrypoints immediately before creating the eszip, with full resolution and no skip/resolver overrides","Ensure every dependency reachable from the entrypoints resolves during graph creation (run `deno cache` to surface errors first)","If it persists, check for a version mismatch between deno_graph and eszip and align them"],"exampleFix":"// before — graph reused from an earlier build; visit set out of sync\nlet eszip = eszip_from_graph(stale_graph, npm_packages, snapshot)?;\n\n// after — build the graph fresh from the same entrypoints, then convert\nlet graph = deno_graph::create_graph(entrypoints.clone(), /* full options */).await;\nlet eszip = eszip_from_graph(graph, npm_packages, snapshot)?;","handlingStrategy":"validation","validationCode":"// before eszip::from_graph: every reachable dep must exist in the graph\nlet mut missing = Vec::new();\nfor module in graph.modules() {\n  for dep in module.dependencies() {\n    if let Some(spec) = dep.maybe_code.or(dep.maybe_type) {\n      if graph.try_get(spec).ok().flatten().is_none() {\n        missing.push(spec.clone());\n      }\n    }\n  }\n}\nassert!(missing.is_empty(), \"modules missing from graph: {missing:?}\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build the ModuleGraph and the eszip from the same entrypoints in the same run","Do not reuse cached or partial graphs across deno_graph upgrades","Run a full `deno cache` before compile-style pipelines to surface resolution gaps"],"tags":["eszip","module-graph","compile","bundling","internal"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}