{"record":{"id":"333f50ddaa7c1e50","repo":"vercel/next.js","slug":"duplicate-page-detected-cyan-existingpagepath","errorCode":null,"errorMessage":"Duplicate page detected. ${cyan(existingPagePath)} and ${cyan(duplicatePagePath)} both resolve to ${cyan(pageName)}.","messagePattern":"Duplicate page detected\\. (.+?) and (.+?) both resolve to (.+?)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/server/lib/router-utils/setup-dev-bundler.ts","lineNumber":787,"sourceCode":"          if (routedPages.includes(pageName)) continue\n        } else {\n          // Pages router\n          const existingPageFilePath = pagesPageFilePaths.get(pageName)\n          if (pagesDir && existingPageFilePath) {\n            duplicatePagePaths.add(pageName)\n\n            if (!previousDuplicatePagePaths.has(pageName)) {\n              const existingPagePath = normalizePathSep(\n                path.join(\n                  'pages',\n                  path.relative(pagesDir, existingPageFilePath)\n                )\n              )\n              const duplicatePagePath = normalizePathSep(\n                path.join('pages', path.relative(pagesDir, fileName))\n              )\n\n              Log.warn(\n                `Duplicate page detected. ${cyan(\n                  existingPagePath\n                )} and ${cyan(duplicatePagePath)} both resolve to ${cyan(\n                  pageName\n                )}.`\n              )\n            }\n          }\n\n          if (useFileSystemPublicRoutes) {\n            pageFiles.add(pageName)\n            opts.fsChecker.nextDataRoutes.add(pageName)\n          }\n\n          const route = normalizePathSep(pageName)\n          const routeEntry = { route, filePath: fileName }\n          if (isAPIRoute(pageName)) {\n            pageApiRoutes.push(routeEntry)","sourceCodeStart":769,"sourceCodeEnd":805,"githubUrl":"https://github.com/vercel/next.js/blob/258b1c1bc05f7099816b88f70b7b3422b24a4b8d/packages/next/src/server/lib/router-utils/setup-dev-bundler.ts#L769-L805","documentation":"Warning from the dev bundler's route watcher in setup-dev-bundler: while indexing page files it found two distinct files (existingPagePath and duplicatePagePath, highlighted in cyan) that both resolve to the same route name pageName — typically the same path existing under both app/ and pages/ directories, or conflicting extensions. Both would serve the same route, so the watcher flags the collision.","triggerScenarios":"Thrown at packages/next/src/server/lib/router-utils/setup-dev-bundler.ts:769 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename or remove one of the duplicate pages so only one file resolves to the route."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"258b1c1bc05f7099816b88f70b7b3422b24a4b8d","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}