-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Next 9 Routing: Requested and resolved page mismatch #9536
Comments
This issue is not actionable without a reproduction. It's a security bailout to make sure the require can't resolve outside the app. (and generally shouldn't be ran into). |
I hava this quesion |
how to fix |
@mengxuhui As said
|
Recently frequent |
@mengxuhui as said in my previous message we need a full reproduction to investigate 🙏 |
@timneutkens I am still having issues reproducing locally even with Sample paths that have caused this error:
|
Error: Requested and resolved page mismatch at Object.normalizePagePath (/search/odin/ocm/nodeapp/sgkf-portal/run/node_modules/next-server/dist/server/normalize-page-path.js:16:15) at getPagePath (/search/odin/ocm/nodeapp/sgkf-portal/run/node_modules/next-server/dist/server/require.js:16:38) at Object.requirePage (/search/odin/ocm/nodeapp/sgkf-portal/run/node_modules/next-server/dist/server/require.js:30:22) at Object.loadComponents (/search/odin/ocm/nodeapp/sgkf-portal/run/node_modules/next-server/dist/server/load-components.js:15:34) at Server.renderToHTMLWithComponents (/search/odin/ocm/nodeapp/sgkf-portal/run/node_modules/next-server/dist/server/next-server.js:224:48) at Server.renderToHTML (/search/odin/ocm/nodeapp/sgkf-portal/run/node_modules/next-server/dist/server/next-server.js:236:37) at Server.render (/search/odin/ocm/nodeapp/sgkf-portal/run/node_modules/next-server/dist/server/next-server.js:192:33) at Object.fn (/search/odin/ocm/nodeapp/sgkf-portal/run/node_modules/next-server/dist/server/next-server.js:150:36) at /search/odin/ocm/nodeapp/sgkf-portal/run/node_modules/next-server/dist/server/router.js:23:36 at Server.run (/search/odin/ocm/nodeapp/sgkf-portal/run/node_modules/next-server/dist/server/next-server.js:161:23) thanks a lot |
@mengxuhui that is not a reproduction. That is an error you're getting in your particular app and is not actionable for us to look into your problem. @derekdowling that is expected as we block any path mismatches to ensure people don't traverse up the directory tree etc. |
@timneutkens should this be an error then, or perhaps a warning? Alternatively, is there a way we can catch this error? We run a custom server so I guess we could wrap Next's handler and then not log if the error message matches this. For context, our team has a policy of alerting when our server encounters any unhandled error which causes this to be really noisy as our service is constantly being scanned by 3rd parties. |
This one isn't unhandled though right? It just renders the 404 page afaik? |
I just don't know the specific reason, so I can ask for help. Errors caught by exceptions |
We can't investigate without a clear and concise reproduction. |
I also got this error on my production server but I have no idea why it happened. I am the only one who knows that the website exists and I don't recall visiting it at that time. Was it some kind of bot? I will report with a proper issue if I can replicate it. Until then, here's the trace. 2020-01-12T15:19:36.914133386Z app[web.1]: Error: Requested and resolved page mismatch
2020-01-12T15:19:36.914504843Z app[web.1]: at Object.normalizePagePath (/app/node_modules/next/dist/next-server/server/normalize-page-path.js:16:15)
2020-01-12T15:19:36.924627903Z app[web.1]: at getPagePath (/app/node_modules/next/dist/next-server/server/require.js:22:38)
2020-01-12T15:19:36.924659614Z app[web.1]: at Object.requirePage (/app/node_modules/next/dist/next-server/server/require.js:43:22)
2020-01-12T15:19:36.924664520Z app[web.1]: at Object.loadComponents (/app/node_modules/next/dist/next-server/server/load-components.js:25:36)
2020-01-12T15:19:36.924668209Z app[web.1]: at Server.findPageComponents (/app/node_modules/next/dist/next-server/server/next-server.js:508:40)
2020-01-12T15:19:36.924671607Z app[web.1]: at Server.renderToHTML (/app/node_modules/next/dist/next-server/server/next-server.js:602:21)
2020-01-12T15:19:36.924675098Z app[web.1]: at Server.render (/app/node_modules/next/dist/next-server/server/next-server.js:489:33)
2020-01-12T15:19:36.924678423Z app[web.1]: at Object.fn (/app/node_modules/next/dist/next-server/server/next-server.js:348:28)
2020-01-12T15:19:36.924681792Z app[web.1]: at processTicksAndRejections (internal/process/task_queues.js:97:5)
2020-01-12T15:19:36.924685053Z app[web.1]: at async Router.execute (/app/node_modules/next/dist/next-server/server/router.js:42:32) |
Posting a stacktrace is not helpful. As said
|
I use AWS ELB and meet this issue also. |
I am having the same issue. Getting this error when trying to redirect from my / route to /en/ page. I am using a custom node.js server to redirect requests based on user location to the respective language page (/en/, /es/, etc).
I have a |
Error: Requested and resolved page mismatch code:
you can try check your render pagePath. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
We encountered an error that isn't especially actionable as a consumer. It would be helpful to either provide more context in the error so it's easier to understand what went wrong, or make the error explain more what we need to do to solve the problem.
It appears to have happened when trying to route
/.
with Next 9 routing in SSR, though I cannot seem to reproduce it. We have a corresponding/index
page as well as a/[foo]
page if that's of any help.I'll try to collect more information if it happens again, but I thought it'd be good to know about since it is puzzling.
Expected behavior
Not sure to be honest.
System information
Additional context
Log Dump
The text was updated successfully, but these errors were encountered: