{"record":{"id":"0e7b455cba1f88be","repo":"vercel/next.js","slug":"specified-basepath-has-to-start-with-a-found","errorCode":null,"errorMessage":"Specified basePath has to start with a /, found \"${result.basePath}\"","messagePattern":"Specified basePath has to start with a /, found \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/server/config.ts","lineNumber":696,"sourceCode":"      `Specified assetPrefix is not a string, found type \"${typeof result.assetPrefix}\" https://nextjs.org/docs/messages/invalid-assetprefix`\n    )\n  }\n\n  if (typeof result.basePath !== 'string') {\n    throw new Error(\n      `Specified basePath is not a string, found type \"${typeof result.basePath}\"`\n    )\n  }\n\n  if (result.basePath !== '') {\n    if (result.basePath === '/') {\n      throw new Error(\n        `Specified basePath /. basePath has to be either an empty string or a path prefix\"`\n      )\n    }\n\n    if (!result.basePath.startsWith('/')) {\n      throw new Error(\n        `Specified basePath has to start with a /, found \"${result.basePath}\"`\n      )\n    }\n\n    if (result.basePath !== '/') {\n      if (result.basePath.endsWith('/')) {\n        throw new Error(\n          `Specified basePath should not end with /, found \"${result.basePath}\"`\n        )\n      }\n\n      if (result.assetPrefix === '') {\n        result.assetPrefix = result.basePath\n      }\n    }\n  }\n\n  if (result?.images) {","sourceCodeStart":678,"sourceCodeEnd":714,"githubUrl":"https://github.com/vercel/next.js/blob/34433fd12ee8074ea3f47af9f36255c7390d0301/packages/next/src/server/config.ts#L678-L714","documentation":"basePath validation in assignDefaultsAndValidate: the value is non-empty and not '/', but fails startsWith('/') — it is a relative path like 'docs'. Path prefixes must be absolute, so the validator rejects it echoing the received basePath.","triggerScenarios":"basePath does not start with a forward slash.","commonSituations":"basePath: 'docs' instead of '/docs' in next.config.","solutions":["Prefix basePath with a leading slash, e.g. /docs."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"34433fd12ee8074ea3f47af9f36255c7390d0301","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}