{"record":{"id":"5dfacf8fa6af3bee","repo":"remix-run/remix","slug":"rmx-route-map-loader-failed-5dfacf","errorCode":"RMX_ROUTE_MAP_LOADER_FAILED","errorMessage":"${message}","messagePattern":"\\$\\{message\\}","errorType":"exception","errorClass":"CliError","httpStatus":null,"severity":"error","filePath":"packages/cli/src/lib/route-map.ts","lineNumber":131,"sourceCode":"    (resolve, reject) => {\n      child.once('error', reject)\n      child.once('close', (code, signal) => {\n        resolve({ code, signal })\n      })\n    },\n  )\n\n  if (exitResult.signal != null) {\n    throw routeMapLoaderSignal(exitResult.signal)\n  }\n\n  if (exitResult.code !== 0) {\n    let message = stderr.trim()\n    if (message.length === 0) {\n      message = 'Route-map loader failed.'\n    }\n\n    throw routeMapLoaderFailed(message)\n  }\n\n  let parsed: unknown\n  try {\n    parsed = JSON.parse(stdout)\n  } catch {\n    throw routeMapLoaderInvalidJson()\n  }\n\n  return assertRawRouteTree(parsed)\n}\n\nfunction decorateRouteTree(\n  rawTree: RawRouteTreeNode[],\n  ownership: ControllerOwnership,\n): RouteTreeNode[] {\n  let subtreesByRouteName = new Map(\n    ownership.subtrees.map((subtree) => [subtree.routeName, subtree]),","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/cli/src/lib/route-map.ts#L113-L149","documentation":"The route-map loader subprocess ran to completion but exited with a nonzero code. Its trimmed stderr becomes the error message (or the generic 'Route-map loader failed.' when stderr is empty), surfacing whatever crashed inside the loader.","triggerScenarios":"The spawned route-map loader process throwing an unhandled exception or calling process.exit(nonzero) — e.g. a broken routes.ts, a failed import inside app code, or a runtime incompatibility.","commonSituations":"Syntax/runtime errors in app/routes.ts or modules it imports; using APIs unavailable to the loader's runtime; app code that throws at module load time.","solutions":["Run the reported stderr message to ground the real failure","Directly import/run your routes.ts (or `remix routes`-style commands) to reproduce the crash","Fix the underlying exception in the app module the loader imports","If the message is empty, run with verbose/debug output to capture loader stderr"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (error) {\n  if (error instanceof Error && error.code === 'RMX_ROUTE_MAP_LOADER_FAILED') {\n    // error.message is the loader's stderr; surface it to the user\n  }\n  throw error\n}","preventionTips":["Keep app/routes.ts and its imports free of top-level throws","Run route loading commands after fixing app syntax errors"],"tags":["cli","routes","subprocess"],"backgroundTag":"subprocess-nonzero-exit","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}