Ok I finally found the minmal combo that makes it fails:
- a rewrite in the next.config.js
- a middleware
- @netlify/plugin-nextjs > 5.9.2
I have a public project here : GitHub - mparisot-antescofo/netlify: Test project for netlify rewrites
on the main branch I am using @netlify/plugin-nextjs@5.9.3 and you can see the issue on https://antescofo-test-netlify-rewrites.netlify.app/
On the branch netlify-5.9.2 I went back to using @netlify/plugin-nextjs@5.9.2 and everything is ok as can be seen on https://deploy-preview-1--antescofo-test-netlify-rewrites.netlify.app/
to see the issue, you need to open the dev tools and hover the links. The first one will be ok as there is no rewrite while the second one will trigger a 404 when fetching bad.json
thank you