{"record":{"id":"854df947b1dbb1e2","repo":"remix-run/react-router","slug":"the-prerender-prerender-paths-config-must-be-a","errorCode":null,"errorMessage":"The `prerender`/`prerender.paths` config must be a boolean, an array of string paths, or a function returning a boolean or array of string paths.","messagePattern":"The `prerender`/`prerender\\.paths` config must be a boolean, an array of string paths, or a function returning a boolean or array of string paths\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/react-router-dev/config/config.ts","lineNumber":559,"sourceCode":"    ...userAndPresetConfigs,\n  };\n\n  if (!ssr && serverBundles) {\n    serverBundles = undefined;\n  }\n\n  if (prerender) {\n    let isValidPrerenderPathsConfig = (p: unknown) =>\n      typeof p === \"boolean\" || typeof p === \"function\" || Array.isArray(p);\n\n    let isValidPrerenderConfig =\n      isValidPrerenderPathsConfig(prerender) ||\n      (typeof prerender === \"object\" &&\n        \"paths\" in prerender &&\n        isValidPrerenderPathsConfig(prerender.paths));\n\n    if (!isValidPrerenderConfig) {\n      return err(\n        \"The `prerender`/`prerender.paths` config must be a boolean, an array \" +\n          \"of string paths, or a function returning a boolean or array of string paths.\",\n      );\n    }\n\n    if (typeof prerender === \"object\" && \"unstable_concurrency\" in prerender) {\n      return err(\n        \"The `prerender.unstable_concurrency` config field has been stabilized as `prerender.concurrency`\",\n      );\n    }\n\n    let isValidConcurrencyConfig =\n      typeof prerender != \"object\" ||\n      !(\"concurrency\" in prerender) ||\n      (typeof prerender.concurrency === \"number\" &&\n        Number.isInteger(prerender.concurrency) &&\n        prerender.concurrency > 0);\n","sourceCodeStart":541,"sourceCodeEnd":577,"githubUrl":"https://github.com/remix-run/react-router/blob/6beaca39526d5716c3c112ebb0782765baa5a9ce/packages/react-router-dev/config/config.ts#L541-L577","documentation":"The `prerender` config field must be a boolean, a function returning boolean/string[], an array of string paths, or an object whose `paths` field is one of those shapes. This validation runs whenever `prerender` is truthy, and anything else — a string like `\"all\"`, a number, an object without a valid `paths` key — returns this error before the build proceeds.","triggerScenarios":"Setting `prerender: \"all\"` (invalid; the boolean form is `prerender: true`), `prerender: 1`, `prerender: { paths: \"/about\" }` (string instead of array), or any other shape that fails `isValidPrerenderPathsConfig` in either the top-level or `paths` position.","commonSituations":"Copy-pasting config from blog posts that use a string shorthand from another framework (Next.js `dynamicParams`-style strings); migrating from an older version and guessing the API; typos like `paths:` given a single string instead of an array.","solutions":["Use the boolean form for full prerendering: `prerender: true`.","List specific paths: `prerender: [\"/\", \"/about\"]`.","Use a function for dynamic sets: `prerender: ({ getStaticPaths }) => getStaticPaths()`.","If using the object form, put one of those same shapes under `paths`: `prerender: { paths: [\"/\"] }`."],"exampleFix":"// before\nexport default { prerender: \"all\" };\n\n// after\nexport default { prerender: true };\n// or\nexport default { prerender: { paths: [\"/\", \"/about\"] } };","handlingStrategy":"validation","validationCode":"type PrerenderShape = boolean | (() => boolean | string[]) | string[] | { paths: boolean | (() => boolean | string[]) | string[] };\nfunction isValidPrerender(p: unknown): p is PrerenderShape {\n  const ok = (v: unknown) => typeof v === \"boolean\" || typeof v === \"function\" || Array.isArray(v);\n  return ok(p) || (typeof p === \"object\" && p !== null && \"paths\" in p && ok((p as any).paths));\n}\nif (!isValidPrerender(config.prerender)) throw new Error(\"invalid prerender config\");","typeGuard":"function isValidPrerender(p: unknown): p is boolean | Function | string[] | { paths: boolean | Function | string[] } {\n  const ok = (v: unknown) => typeof v === \"boolean\" || typeof v === \"function\" || Array.isArray(v);\n  return ok(p) || (typeof p === \"object\" && p !== null && \"paths\" in p && ok((p as any).paths));\n}","tryCatchPattern":null,"preventionTips":["Type the config: `export default { prerender: true } satisfies ReactRouterConfig`.","Remember there is no string form — full prerendering is `true`, not \"all\".","When using the object form, put the list under `paths` as an array of strings."],"tags":["config","prerender","validation","build"],"backgroundTag":"invalid-config-value","analyzedSha":"6beaca39526d5716c3c112ebb0782765baa5a9ce","analyzedAt":"2026-08-18T18:04:14.938Z","contentChangedAt":"2026-08-18T18:04:14.938Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}