-
Notifications
You must be signed in to change notification settings - Fork 0
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
Product Pages: Support encoded slashes #2163
Conversation
See: vercel/next.js#49646 We have slashes in some variants. You can see the bug by visiting: * https://www.ifixit.com/Parts/iPhone_XR:A1984_US%2FCanada * Click Any item type and the page loads fine * Refresh and the page 404s This works around the issue by manually handling the url parsing for this page. We only needed the path segments
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
📦 Next.js Bundle Analysis for @ifixit/commerce-frontendThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
* Instead of: | ||
* ['device', 'variant/WithASlash'] | ||
*/ | ||
const path = context.resolvedUrl.split('?')[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forget which is which, but will this be the right url when the client side is hitting the next.js data
api to just get the props?
I'm not entirely sure we'll run into instances where that will happen for this case, but it seems feasible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://nextjs.org/docs/pages/api-reference/functions/get-server-side-props#context-parameter
resolvedUrl
A normalized version of the request URL that strips the _next/data prefix for client transitions and includes original query values.
The docs don't indicate much clarity here, but it seemed safe enough to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like the right one!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR ⚡ Shame that we have to do this, but it looks ok to me!
QA 🎬 |
See: vercel/next.js#49646
We have slashes in some variants.
You can see the bug by visiting:
This works around the issue by manually handling the url parsing for this page. We only needed the path segments.