-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Issue Mismatch ssr with dev__ssr for route with TrailingSlash #31996
Comments
one update on this patch
need to add param in all renderDevHTML access like here
to
and
change to
|
Hi, thanks for the issue! I see that your issue is about a specific experiment/flag we currently have. We collect any feedback (bug reports, feature requests, questions, etc.) inside a respective discussion in the Umbrella Discussions category. Please direct your feedback here: #28138 Thanks! |
Mismatch ssr caused by location.pathname
I found an issue for route ending with a TrailingSlash
by example:
localhost/myroute/
if the route in .cache/match-paths.json contain without TrailingSlash
path: /myroute,
as a result location.pathname from Server is different than window.location.pathname from client
it's create SSR mismatch
solution to patch in src/utils/start-server.js ->
gatsby/packages/gatsby/src/utils/start-server.ts
Lines 505 to 512 in 308eb94
need to correct the path
replace pathObj.path to the original path req.path
i did updated in reachroute the code below and it gave me this issue. (yes it s a snippet of old gatsby-link but it's work)
aria-current with test location.pathname === prefixedTo give true for client and false for Server due to the lack of "/" in the pathname
The text was updated successfully, but these errors were encountered: