{"record":{"id":"17603cc4108b0672","repo":"vercel/next.js","slug":"specified-basepath-basepath-has-to-be-either-an","errorCode":null,"errorMessage":"Specified basePath /. basePath has to be either an empty string or a path prefix\"","messagePattern":"Specified basePath /\\. basePath has to be either an empty string or a path prefix\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/server/config.ts","lineNumber":690,"sourceCode":"      }\n    }\n  }\n\n  if (typeof result.assetPrefix !== 'string') {\n    throw new Error(\n      `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 === '') {","sourceCodeStart":672,"sourceCodeEnd":708,"githubUrl":"https://github.com/vercel/next.js/blob/34433fd12ee8074ea3f47af9f36255c7390d0301/packages/next/src/server/config.ts#L672-L708","documentation":"basePath validation in assignDefaultsAndValidate: the value is the string '/'. A lone slash is not a usable path prefix — the root is expressed as an empty string — so the validator rejects it and states basePath must be '' or a real path prefix like '/docs'.","triggerScenarios":"basePath is set to just '/' or an invalid prefix.","commonSituations":"basePath must be empty or a real path prefix like '/docs', not '/'.","solutions":["Set basePath to an empty string or a path prefix like /docs, not just /."],"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"}