opennextjs-netlify: Dynamic routes not working well If an error page is added.

correct me if I am wrong, all static files should be served from functions directly anything else should go through my _app, right?

I deployed a serverless NEXTJS application that implements SSR ( server-side rendering ), and it has some dynamic routes. It works fine until I press on a link that links to a page that had a dynamic route… for example branches/[id] It sends a request to get the static js file or the chunk js file needed to serve the page … but instead of getting the file directly because it’s a static js file, it goes through my _app! which makes a redirection to the default locale.

static file URL example https://example.app/_next/static/chunks/pages/branches/%5Bid%5D-91768ff65c2a79ad38ee.js when it goes through _app it get redirected to https://example.app/en/_next/static/chunks/pages/branches/%5Bid%5D-91768ff65c2a79ad38ee.js which doesn’t exist so, it sends a 404 page.

environment: node version: 14.15.1 next version: 10.0.9

and I am using new “@netlify/plugin-nextjs” plugin to deploy

PLEASE HELPPPPP

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 23 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Hi @Doaa-Ismael, This was indeed a bug in our server with the handling of URL-encoded paths, which has now been fixed. Your repro seems to work now. Thanks for the detailed report!

@lindsaylevine Thank you, you are right, the issue discreption is misleading so I was thinking of updating it 🙏.