{"record":{"id":"a029a224486bdcb3","repo":"abhigyanpatwari/GitNexus","slug":"cross-file-route-extraction-failed-for-rootpath","errorCode":null,"errorMessage":"Cross-file route extraction failed for ${rootPath}","messagePattern":"Cross-file route extraction failed for (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"gitnexus/src/core/ingestion/pipeline-phases/parse-impl.ts","lineNumber":373,"sourceCode":"    for (const rootPath of rootPaths) {\n      const rootContent = reader(rootPath);\n      if (rootContent === null) continue; // skip this root only, not the language\n\n      let rootTree: Parser.Tree;\n      try {\n        rootTree = parseSourceSafe(parser, rootContent);\n      } catch {\n        logger.warn(`Skipping unparseable root route file: ${rootPath}`);\n        continue; // skip this root only\n      }\n\n      // Isolate a misbehaving provider: a throw here must not abort the whole\n      // analyze (mirrors the worker's per-file isolation). Skip this root, warn.\n      try {\n        const routes = provider.extractRoutes(rootTree, rootPath, reader, parser);\n        for (const r of routes) out.push(r);\n      } catch (err) {\n        logger.warn({ err }, `Cross-file route extraction failed for ${rootPath}`);\n      }\n    }\n  }\n\n  return out;\n}\n\n/**\n * Handle a worker-pool startup failure by FAILING FAST with the captured cause\n * (#1741). The pool self-heals *transient* worker crashes on its own — a\n * bounded, jittered startup restart loop (see worker-pool.ts) — so this is\n * reached only when that self-heal is EXHAUSTED, or a deterministic crash-loop\n * was detected, or the pool could not even be constructed. In every such case\n * the workers genuinely cannot start.\n *\n * There is no sequential parser to silently degrade to — that fallback was\n * removed (and it had masked a worker-startup regression as a 2-hour \"stuck\"\n * run in #1741, rc99: a dropped `logger.warn` plus an unbounded sequential","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/0d1aed942f0e8b5d3bac27519fff441aceea722d/gitnexus/src/core/ingestion/pipeline-phases/parse-impl.ts#L355-L391","documentation":"During the parse phase, language providers that implement discoverRootRouteFiles/extractRoutes run cross-file framework route extraction: each discovered root route file is parsed with parseSourceSafe, then provider.extractRoutes(rootTree, rootPath, reader, parser) walks it (following include()/reader reads). A throw from inside a provider on one root is deliberately isolated — the catch warns 'Cross-file route extraction failed for ${rootPath}' and moves to the next root, mirroring the worker's per-file isolation so one misbehaving provider cannot abort the whole analyze.","triggerScenarios":"provider.extractRoutes throwing on a specific root: a route config written in a style the provider does not model (dynamic requires, spread of imported arrays, build-time codegen), an unexpected AST shape in the parsed root tree, or reader returning content the provider mishandles.","commonSituations":"Framework route configs that are unusual or generated; monorepos where one project root is exotic while others are standard; framework version drift between the app's router patterns and the provider's expectations.","solutions":["Inspect the { err } field in the log entry for the provider's stack trace","Simplify or normalize the offending root route file toward static, framework-idiomatic route declarations","Check whether your framework/version is covered by the language provider's route extractor","Report the file plus stack upstream — routes from the other roots were still extracted"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const routes = provider.extractRoutes(rootTree, rootPath, reader, parser);\n  out.push(...routes);\n} catch (err) {\n  logger.warn({ err }, `Cross-file route extraction failed for ${rootPath}`); // isolate one root, keep the rest\n}","preventionTips":["Keep framework route configs static and idiomatic — avoid dynamic require/spread-of-imports patterns in root route files","After upgrading your web framework, re-check that route extraction still covers your config style","Verify route coverage with a query when route discovery matters to your workflow","Report the root file plus { err } stack so the provider can learn the shape"],"tags":["routes","framework","provider","ingestion","isolation"],"backgroundTag":"plugin-provider-exception","analyzedSha":"0d1aed942f0e8b5d3bac27519fff441aceea722d","analyzedAt":"2026-08-20T23:29:22.980Z","contentChangedAt":"2026-08-20T23:29:22.980Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}