{"record":{"id":"ac40ef0a8f9422b7","repo":"remix-run/remix","slug":"route-map-loader-returned-invalid-children-for","errorCode":null,"errorMessage":"Route-map loader returned invalid children for \"${name}\".","messagePattern":"Route-map loader returned invalid children for \"(.+?)\"\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/lib/route-map.ts","lineNumber":255,"sourceCode":"  if (typeof value !== 'object' || value == null) {\n    throw new Error('Route-map loader returned an invalid route node.')\n  }\n\n  let key = Reflect.get(value, 'key')\n  let name = Reflect.get(value, 'name')\n  let kind = Reflect.get(value, 'kind')\n  let children = Reflect.get(value, 'children')\n\n  if (typeof key !== 'string' || typeof name !== 'string') {\n    throw new Error('Route-map loader returned a route node without a valid name.')\n  }\n\n  if (kind !== 'group' && kind !== 'route') {\n    throw new Error(`Route-map loader returned an unknown node kind for \"${name}\".`)\n  }\n\n  if (!Array.isArray(children)) {\n    throw new Error(`Route-map loader returned invalid children for \"${name}\".`)\n  }\n\n  if (kind === 'group') {\n    return {\n      children: children.map((child) => assertRawRouteTreeNode(child)),\n      key,\n      kind,\n      name,\n    }\n  }\n\n  let method = Reflect.get(value, 'method')\n  let pattern = Reflect.get(value, 'pattern')\n\n  if (typeof method !== 'string' || typeof pattern !== 'string') {\n    throw new Error(`Route-map loader returned an invalid route leaf for \"${name}\".`)\n  }\n","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/cli/src/lib/route-map.ts#L237-L273","documentation":"The `children` field of every node (both groups and route leaves) must be an array. This error fires when children is missing or not an array during tree validation.","triggerScenarios":"A node where children is undefined/null/object — typically schema drift between worker and validator versions, or hand-built test data omitting children.","commonSituations":"Version mismatch after partial upgrade; fixtures that model leaves without a children array.","solutions":["Reinstall dependencies to align remix versions","Add `children: []` to leaf nodes in test fixtures","Regenerate the tree from the real worker"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"tree.every(n => Array.isArray((n as any).children))","typeGuard":"function hasChildren(n: unknown): n is { children: unknown[] } {\n  return Array.isArray((n as any)?.children)\n}","tryCatchPattern":null,"preventionTips":["Include children: [] on leaf fixtures","Regenerate fixtures with the real worker","Keep package versions aligned"],"tags":["routes","worker","internal","validation"],"backgroundTag":"invalid-worker-response","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}