New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate page name error display needs improved #2820
Comments
|
Would it be possible to handle this error in a way that would keep the development server running? When I am making new pages, I frequently copy and paste an existing page. This usually causes the development server to crash: Listening on 127.0.0.1:9181.
info - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
warn - You have enabled experimental feature(s).
warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use them at your own risk.
Error: The page component is named "UpdateFAQ" on both the /cms/frequentlyAskedQuestion/[id] and /cms/blah/create routes. The page component must have a unique name across all routes, so change the component name on one of those routes to avoid conflict.
at /workspaces/monorepo/node_modules/next/dist/build/routes.js:193:23
at Array.filter (<anonymous>)
at dedupeBy (/workspaces/monorepo/node_modules/next/dist/build/routes.js:182:16)
at generateManifest (/workspaces/monorepo/node_modules/next/dist/build/routes.js:200:37)
at Object.saveRouteManifest (/workspaces/monorepo/node_modules/next/dist/build/routes.js:116:47)
at async DevServer.prepare (/workspaces/monorepo/node_modules/next/dist/server/dev/next-dev-server.js:239:9)
at async /workspaces/monorepo/node_modules/next/dist/cli/next-dev.js:120:9
node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "1".] {
code: 'ERR_UNHANDLED_REJECTION'
}
@ajwgeek ➜ /workspaces/monorepo (canary ✗) $ |
|
Hi @flybayer may I work on this issue? |
|
hey @lucas-barros thank you, i have assigned you, do let us know if you need any help with this issue! |
|
I already open the PR for this issue 4 days ago. Anyone, please review. |
Hey @p-siriphanthong, I'm sorry for the delay. I'll review it today. |


What is the problem?
As you can see in the below log, it's hard to read and parse the error message.
Paste all your error logs here:
What are detailed steps to reproduce this?
Pageor anything else, as long as all pages have same nameblitz devHow to fix
Here's the current code for this: https://github.com/blitz-js/blitz/blob/canary/nextjs/packages/next/build/routes.ts#L227-L232
Essentially solution is instead of throwing full error message, first log pretty error with
baseLogger.error(), then throw error with "Duplicate Page Name". But first deleteerror.stackbefore throwing so it won't log.The text was updated successfully, but these errors were encountered: