-
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
fix(gatsby): remove 404 pagedata logic on client side pages #17412
Conversation
looks like tests aren't passing yet |
I've tested it manually and our e2e tests cover it basically pretty well. I've published a canary version on |
This looks great overall to me! Will hold off on merging this in for now since you've added the needs manual testing label |
Not sure if this is helpful but i tried this with a project that was impacted by these 404s (and limiting page speeds) and problems "vanished". thanks for working on this :) |
Just tested this on a project with |
It seems like there are some troubles with prefetching page-data that is still happening, I can't really reproduce it so I would suggest merging this one and I'll ask for reproduction for a follow-up fix. |
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.
Looks good!
Same here, had to rollback to 2.15.22, otherwise pages created with |
Hmmm ... rolled back to 2.15.22 but still this particular post gives 404: http://metamn.io/react/react-follows-the-functional-reactive-programming-paradigm/ Try to refresh it: First the page is rendered then it is replaced by the 404. I've done everything: empty cache, renamed the post twice, upgraded all packages ... and nothing. Thanks! |
@metamn Do you have a matchPath or client only route to provide the 404 page? Can you share the contents of .cache/match-paths.json in your project? |
@Sever1an For the first question: I don't know but here is the repo: https://github.com/metamn/react
|
@metamn Probably not related to the issue reported above by JustFly1984. A brief examination reveals that the page is attempting to fetch the page-data.json from an incorrect url: The page-data.json does exist at the correct url: |
Thanks @Sever1an !! Any hints why is that? Cleaning cache would help? |
Or should I file a separate issue? |
I think it would be helpful to create a new issue referencing your suspicion that it started with this pull request and sharing the insight about searching at the wrong url for a If possible please create a tag or branch of a version of the site known to cause the problem and reference it too. The Gatsby core team is at a conference and not available this week so keeping things as well structured and clean as possible here will help tremendously. |
Thanks again! :) |
@antoinerousseau Do you have a github of the affected project? Do you have anything in |
Description
We have got a few complaints about page-date returning 404s when doing client side only pages. We fetched page-data of every page and when it returned a 404 we fallback to matchpath.
This pr writes pages that are inside a matchpath to matchpath.json so we can safely rely on match-path.json.
It reverts most of #15762 which was added to do the 404 page-data checks.
Still on my todo is to add a simple test for the findPath function.
Related Issues
Fixes #16097