{"record":{"id":"7c45ed08000ae379","repo":"remix-run/react-router","slug":"the-routediscovery-manifestpath-config-must-be-a","errorCode":null,"errorMessage":"The `routeDiscovery.manifestPath` config must be a root-relative pathname beginning with a slash (i.e., \"/__manifest\")","messagePattern":"The `routeDiscovery\\.manifestPath` config must be a root-relative pathname beginning with a slash \\(i\\.e\\., \"/__manifest\"\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/react-router-dev/config/config.ts","lineNumber":606,"sourceCode":"      routeDiscovery = {\n        mode: \"lazy\",\n        manifestPath: \"/__manifest\",\n      };\n    } else {\n      routeDiscovery = { mode: \"initial\" };\n    }\n  } else if (userRouteDiscovery.mode === \"initial\") {\n    routeDiscovery = userRouteDiscovery;\n  } else if (userRouteDiscovery.mode === \"lazy\") {\n    if (!ssr) {\n      return err(\n        'The `routeDiscovery.mode` config cannot be set to \"lazy\" when setting `ssr:false`',\n      );\n    }\n\n    let { manifestPath } = userRouteDiscovery;\n    if (manifestPath != null && !manifestPath.startsWith(\"/\")) {\n      return err(\n        \"The `routeDiscovery.manifestPath` config must be a root-relative \" +\n          'pathname beginning with a slash (i.e., \"/__manifest\")',\n      );\n    }\n\n    routeDiscovery = userRouteDiscovery;\n  }\n\n  let appDirectory = Path.resolve(root, userAppDirectory || \"app\");\n  let buildDirectory = Path.resolve(root, userBuildDirectory);\n\n  let rootRouteFile = findEntry(appDirectory, \"root\", { absolute: true });\n  if (!rootRouteFile) {\n    let rootRouteDisplayPath = Path.relative(\n      root,\n      Path.join(appDirectory, \"root.tsx\"),\n    );\n    return err(","sourceCodeStart":588,"sourceCodeEnd":624,"githubUrl":"https://github.com/remix-run/react-router/blob/6beaca39526d5716c3c112ebb0782765baa5a9ce/packages/react-router-dev/config/config.ts#L588-L624","documentation":"With lazy route discovery, the client fetches route manifests from `manifestPath` (default `/__manifest`). The value must be a root-relative pathname starting with `/`; anything else — `__manifest`, `manifest.json`, `https://cdn.example.com/__manifest` — fails the `startsWith(\"/\")` check when `manifestPath` is explicitly set alongside `mode: \"lazy\"`.","triggerScenarios":"Explicitly configuring `routeDiscovery: { mode: \"lazy\", manifestPath: \"__manifest\" }` (missing leading slash) or an absolute URL; the check only runs for non-null values with lazy mode, so `undefined` keeps the default.","commonSituations":"Customizing the manifest path to avoid conflicts with an existing `/__manifest` route; copying a path constant that is stored without the leading slash; intending a CDN host and putting the full URL in this field (not supported — it is server-relative).","solutions":["Prefix the path with a slash: `manifestPath: \"/__manifest\"` or your custom `/api/manifest`.","Omit `manifestPath` to use the default `/__manifest`.","If you need the manifest elsewhere, remember it is served by your app's origin — keep it root-relative."],"exampleFix":"// before\nexport default {\n  routeDiscovery: { mode: \"lazy\", manifestPath: \"__manifest\" },\n};\n\n// after\nexport default {\n  routeDiscovery: { mode: \"lazy\", manifestPath: \"/__manifest\" },\n};","handlingStrategy":"validation","validationCode":"function isRootRelative(p: string): boolean {\n  return p.startsWith(\"/\");\n}\nif (manifestPath != null && !isRootRelative(manifestPath)) {\n  throw new Error(\"routeDiscovery.manifestPath must start with '/'\");\n}","typeGuard":"function isRootRelativePathname(p: string): p is `/${string}` {\n  return p.startsWith(\"/\") && !/^\\/\\//.test(p);\n}","tryCatchPattern":null,"preventionTips":["Omit manifestPath unless you genuinely need a custom endpoint path.","Store custom endpoint paths with the leading slash in one constants module.","Never put an absolute URL or bare filename in this field."],"tags":["config","route-discovery","path-validation","lazy-routes"],"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-14T00:17:10.932Z"}