Hello,
I posted a while ago about 404 issues when upgrading @netlify/plugin-nextjs from 5.9.2 to 5.9.3.
Unfortunately I wasn’t able to figure out the issue despite the help and had to put it on hold until now. I was hoping to get lucky and for the issue to be fixed but I also tried the last version of the plugin and the issue is still there.
I finally was able to investigate more and what I see everything is behaving as if my rewrites rules configured in next.config.ts are ignored when requesting a page from the client (the json part) while everything works fine on on a full load of the page (the full html)
The issue can be seen on https://deploy-preview-626--metronautapp.netlify.app/
On that branch I updated @netlify/plugin-nextjs to 5.9.3 (and nextjs to the last version in case it would fix the issue) and what I see is:
- Any page is loading fine on the first load
- if I hover a link targeting a page without a rewrite all is fine (discover or catalog for instance)
- if I hover a link targeting a page with a rewrite I get a 404 on the page.json call (blog which rewrites metronaut-blog to blog)
- if I click on a rewriten link then I’ll get a full page reload instead of a javascript navigation like expected
So it seems that any page where the route doesn’t match the folder name returns a 404 when trying to get the next data json associated to it.
The old topic in case it might be of use: 404 on all routes when navigating on client side after updating @netlify/plugin-nextjs
Thank you