{"record":{"id":"292c8c2b3a1f3edb","repo":"remix-run/remix","slug":"invalid-route-map-value-at-name-expected-a-r","errorCode":null,"errorMessage":"Invalid route map value at \"${name}\". Expected a route or nested route object.","messagePattern":"Invalid route map value at \"(.+?)\"\\. Expected a route or nested route object\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/lib/load-route-map-worker.ts","lineNumber":80,"sourceCode":"          children: [],\n          key,\n          kind: 'route',\n          method: routeLeaf.method,\n          name,\n          pattern: routeLeaf.pattern,\n        } satisfies RawRouteTreeNode\n      }\n\n      if (isPlainObject(entryValue)) {\n        return {\n          children: normalizeRouteGroup(entryValue, nameSegments, seen),\n          key,\n          kind: 'group',\n          name,\n        } satisfies RawRouteTreeNode\n      }\n\n      throw new Error(\n        `Invalid route map value at \"${name}\". Expected a route or nested route object.`,\n      )\n    })\n  } finally {\n    seen.delete(value)\n  }\n}\n\nfunction readRouteLeaf(value: unknown): { method: string; pattern: string } | undefined {\n  if (typeof value !== 'object' || value == null) return undefined\n\n  let method = Reflect.get(value, 'method')\n  let pattern = Reflect.get(value, 'pattern')\n  if (typeof method !== 'string' || !hasToString(pattern)) return undefined\n\n  return { method, pattern: pattern.toString() }\n}\n","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/cli/src/lib/load-route-map-worker.ts#L62-L98","documentation":"Each entry inside a group object must be either a leaf route object or another nested group object. Anything else (string, number, array, null) at that key triggers this error with the offending key name.","triggerScenarios":"A property of a route group that is not a route/group object, e.g. `{ pages: { home: 'home.tsx' } }` or extra metadata like `{ layout: 42 }`.","commonSituations":"Attaching helper flags, comments-as-keys, or string file names directly inside groups; mixing conventions from other config formats.","solutions":["Convert the offending entry to a route object or nested group object","Move non-route metadata out of the routes map into separate constants","Check the key named in the message and fix only that entry"],"exampleFix":"// before\nexport let routes = { pages: { home: 'home.tsx' } }\n// after\nexport let routes = { pages: { home: { file: 'home.tsx' } } }","handlingStrategy":"type-guard","validationCode":"for (let [key, value] of Object.entries(group)) {\n  if (!isPlainObject(value)) throw new Error(`invalid entry ${key}`)\n}","typeGuard":"function isRouteEntry(v: unknown): v is Record<string, unknown> {\n  return typeof v === 'object' && v !== null && !Array.isArray(v)\n}","tryCatchPattern":null,"preventionTips":["Keep helper metadata outside the routes map","Type the group values so TS rejects strings/numbers","Validate with `remix routes` in CI"],"tags":["routes","config","validation"],"backgroundTag":"config-validation-failed","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}