Error 500 nextjs 13 dinamic routing

Hi, is the second site i try to deploy here with no luck. The problem is always related to dynamic routes in nextjs 13. I use queryParams in Link component to get single page blog data, in dev everything is fine, in production if i try to access directly to the page (just pasting the url the browser bar) i get error 500.
So i tried i vercel and there is no problem at all.
I get no error or warning building the site.
What can i do?

Ok, even with no query parameters, but just with the clean url, if i refresh the page i get error 500.
No info, i checked out all the internet…

Hi @designtoy sorry to hear your site is not working as intended can you please check out solution in this thread and see if it helps: After deploying nextjs app with nextAuth, I get 500 Server Internal Error - #5 by naor88

Hi SamO, thanks for the answer.
@netlify/plugin-nextjs package is now version 4.36.1, as suggested in the thread you linked.
made the toml file. No luck.
What can i do?

I think this is something important. I made a “test” folder with a [test] “dynamic” folder inside and a page.tsx.
Inside the page.txt i just write dummy text, no api, nothing at all.
So o tried /test/just-a-test
The same error occurred.
It’s like there is no support for dynamic routes for next 13.
Someone has a next 13 with app routing working on netlify?

We got something similar. Instead of 404, we got 500 accessing an unknown route. After a lot of debugging, we found that it was only possible to get the 404 page if we updated @netlify/plugin-nextjs to 4.36.1 and downgraded nextjs to 13.3.1. It was the only working solution.

Is not a great solution and we don’t have the same problem on other hosting sites.

1 Like

With your settings everything is fine.
But i had to back to the experimental version of nextjs. We need soon some better solution cause Netlify is a major hosting service.
Hope someone from the tech team find some solution to this issue.

I’m not sure how to reproduce the error, @designtoy. I tried visiting: paolodedomini-Blog Non è più l’adobe di una volta (, but it works fine.

Maybe you’re also affected by: Server.edge not defined Error on nextJS SSR functions cause site to return 500 Errors

Sorry i restored the version related to the routing problem.
Do you have a starter repository working with last nextjs and app routing?
I tried some other site for test and i got the same error

It’s the same error I mentioned above:

hrishikesh Yes! now it seems fine! I installed the plugin 4.38.0.

I still get the same error, even with nextjs-runtime 4.38.1

Jun 22, 05:21:18 PM: 01f7ce93 ERROR  Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './server.edge' is not defined by "exports" in /var/task/node_modules/.pnpm/next@13.4.7_ob7c7ogpcitikph4afkm5ompve/node_modules/react-dom/package.json

Tried nearly everything, with and without prebuildscript etc.

Maybe it is because of the middleware routing?
site as deployed here:

Same deployment works on Vercel …

@dreieinsvier, since you’re using pnpm, have you checked out: Next.js on Netlify | Netlify Docs?


Thank you for your reply, but unfortunately still i get the same error.
I already had the public hoisting set in my .npmrc.
Added the env variable with the pnpm flag but without success.

I now also tried to build it with npm, but still getting the same error on netlify.

Hi, sorry for the delay can you provide your site ID please.

@SamO, Sure!

Here is the ID: 69249fa8-6422-4f7a-8d2a-4ba1b4a3ee65.

My current deplyoment useses NextJS 13.3.1 again and nextjs-runtime 4.36.1 though.
Because it is the only way the sites works.


Thanks for sharing. We can confirm this is still happening for some sites and I believe a fix would be up shortly.

Can you check this @dreieinsvier: Server.edge not defined Error on nextJS SSR functions cause site to return 500 Errors - #64 by hrishikesh?