vercel/next.js · error
Duplicate page detected. ${cyan(existingPagePath)} and ${cya
Error message
Duplicate page detected. ${cyan(existingPagePath)} and ${cyan(duplicatePagePath)} both resolve to ${cyan(pageName)}. What it means
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.
Source
Thrown at packages/next/src/server/lib/router-utils/setup-dev-bundler.ts:787
if (routedPages.includes(pageName)) continue
} else {
// Pages router
const existingPageFilePath = pagesPageFilePaths.get(pageName)
if (pagesDir && existingPageFilePath) {
duplicatePagePaths.add(pageName)
if (!previousDuplicatePagePaths.has(pageName)) {
const existingPagePath = normalizePathSep(
path.join(
'pages',
path.relative(pagesDir, existingPageFilePath)
)
)
const duplicatePagePath = normalizePathSep(
path.join('pages', path.relative(pagesDir, fileName))
)
Log.warn(
`Duplicate page detected. ${cyan(
existingPagePath
)} and ${cyan(duplicatePagePath)} both resolve to ${cyan(
pageName
)}.`
)
}
}
if (useFileSystemPublicRoutes) {
pageFiles.add(pageName)
opts.fsChecker.nextDataRoutes.add(pageName)
}
const route = normalizePathSep(pageName)
const routeEntry = { route, filePath: fileName }
if (isAPIRoute(pageName)) {
pageApiRoutes.push(routeEntry)View on GitHub (pinned to 258b1c1bc0)
Solutions
- Rename or remove one of the duplicate pages so only one file resolves to the route.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/next/src/server/lib/router-utils/setup-dev-bundler.ts:769 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of vercel/next.js@258b1c1bc0 (2026-08-19).
Data as JSON: /api/errors/333f50ddaa7c1e50.
Report an issue: GitHub.