-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
404 is shown for 1 second before matching client paths ( /blog is one of the example) #5391
base: main
Are you sure you want to change the base?
Conversation
Size Changes%0A
|
This doesn't look like a good fix to me. It tries to work around the problem by showing different content on the client on the server (which is not supported by React). What is the real canonical way to solve this? |
@gaearon In 2018, Gatsby team fixed this problem in their package and they started supporting SSR stuff in V3. You are using a version lesser then v3. There is no actual way to resolve it other then updating the package itself. I had it updated and i think change of this level will not be accepted in this regard ( can also cause conflicts ). So i came up with this solution that i have implemented. I can also create a PR after updating the version of Gatsby to v3 if you want. ATM this is the only possibility to fix it. @gaearon What do you think about this? And please do mention why it is not a good solution ( just for the sake of getting the ideas you have in your mind )? |
@gaearon I have seen there is a route to redirect /blog to /blog/all.html with all the Blogs listing, this can also be done here. Furthermore i have looked into updating the Gatsby to v3, the amount of work on it is drastic and has many conflicts with other packages. I think we should redirect the /blog to /blog/all.html or accept the work around done here because it is also recommended by Gatsby team if there is drastic change in codebase for version upgrade from v2 to v3. etc. What do you think ? |
@gaearon Thanks for implementing the idea i gave here. Now blogs are working fine. |
Greetings
Hi React Team,
This is my first time open source contribution. I have followed the React Guidelines too.
Issue
When we hit the blogs Link from [Beta] docs, the 404 page is shown for a second and then actual content is got through graphQl Query and is displayed.
Bad UX
It's not naive to say that it creates a bad UX. I myself ( while i was on slow internet ), thought that docs server is down and moved away from website twice.
Solution for Gatsby
I have been working on this and found out that this thing was fixed in Gastby new versions, and there is an implemenation/work around to fix this into previous versions ( that react docs are using). I have managed to fix it and am creating this PR.
Testing
Please do let me know if there are further changes required in this PR. I have tested it and it's working fine. :)