-
Notifications
You must be signed in to change notification settings - Fork 88
[Bug]: 404 page for static routes using getStatic... #2043
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
Comments
Hi @alianza, prior to version 4.23.0 of our Next.js Runtime there was a bug that caused non-prerendered paths on |
Thank you for the reply and instructions! I'm quite sure the correct data is coming through in my
Then in Same for other dynamic pre-rendered routes like the blog. Returned postId's look correct. E.g.:
In Otherwise this wouldn't run correctly locally either, but locally everything works as expected without any custom Also in the Netlify build logs I can see it built the pages:
Is there anything I should do differently to make sure my application behaves the same when deployed on Netlify as it does locally when it comes to these statically generated (dynamic) routes? Previously that was never the case and the local development experience reflected what would be expected when deployed on Netlify. Also if I build locally and then serve the application using Moreover I tried running the project using Netlify CLI locally, this also worked as expected with all dynamic routes also working as expected. I'm unsure how to continue looking for what is going wrong when the site is deployed to Netlify. Lastly I deployed the site to Vercel instead, which worked no problem and all pre-rendered (dynamic) routes worked perfectly too. I would be very surprised if my application relies on a bug that would have had to be present for so long, affecting such a basic functionality for Next.js, such as pre-rendered (dynamic) routes when at the same time all other types of testing this functionality (Local dev, local build + serve, Netlify CLI & Vercel) do all behave as expected. I hope this information helps! |
Thank you for reporting this with a great repro and thanks for your detailed reply! This is a bug in our Runtime due to a change in Next.js v13.3.0. We have a PR ready to go and are hoping to get it merged into the release next week. Will update here when we do. |
Great to hear. Thanks for the swift responses! Looking forward to the fix and to hear from it! Good day |
Amazing! I redeployed my site without changes and all the (pre-rendered dynamic routes) work properly again! Thank you for the quick resolution! |
Summary
My next.js site started showing 404's for dynamic routes using getStaticPaths and getStaticProps. Also nested routes like /blog/article throw a 404. This seems to be related to this issue on Netlify forums: https://answers.netlify.com/t/nextjs-routes-404-on-successful-build/89630 But I couldn't find any trackable issue for it.
I was able to resolve some of the 404's by adding
fallback: 'blocking'
togetStaticPaths
but routes only usinggetStaticProps
are still broken. alianza/portfolio-lea@75b6d2dSteps to reproduce
A link to a reproduction repository
https://github.com/alianza/portfolio-lea
Next Runtime version
v4.34.0
Is your issue related to the
app
directory (beta)?app
directoryMore information about your build
netlify.toml
)What OS are you using?
Windows
Your netlify.toml file
`netlify.toml`
Your public/_redirects file
`_redirects`
Your
next.config.js
file`next.config.js`
Builds logs (or link to your logs)
Build logs
Paste logs here
Paste file contents here. Please check there isn't any private info in them
You can either build locally, or download the deploy from Netlify by clicking the arrow next to the deploy time.
The text was updated successfully, but these errors were encountered: