-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
Vercel's edge runtime responds with 500 Internal Server Error #48378
Comments
fixed in v13.3.1-canary.6 |
Seems to be broken in v13.3.1-canary.9 |
Having the same issue (in my case with nested dynamic routes like /[en]/artist/[jim]) in v13.3.1-canary.11 |
This occurs only when parent route has dynamic segment ie |
I have the same issue in latest release 13.3.1 and same in canary 19. |
I have encountered this issue in the latest @ivorhoulker mentions that adding a random query parameter forces the route to actually work. I can confirm that this workaround still works in Hopefully, the issue will be fixed soon. |
Just struggled out a solution. My issue was that the previous versions of Nextjs's api routes were extremely forgiving. I was using this pattern:
It did not return anything and yet I could retrieve data on on the frontend with this pattern:
Blew up with the error OP got. Routes giving me 500 errors. I'm using a similar pattern, but now I'm returning the response and it works. The way that the data is fetched in the component is unchanged. I'm using this pattern because I need a try/catch block inside of
|
Can confirm this happens with rewrites too. Rewriting to tenant.com to /[tenant]/a-route expects Unable to reproduce locally even with Edge enabled, only happens after deploying to Vercel.
Edit: This only happens for nested dynamic segments. For example:
|
13.4.1 same issue |
Appears to be fixed for me in |
This is fixed in #49315 indeed! Thanks for the report 🙏 |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:39:35 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T8103 Binaries: Node: 16.13.2 npm: 8.1.2 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 13.3.0 eslint-config-next: 13.3.0 react: 18.2.0 react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Middleware / Edge (API routes, runtime), Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue
https://github.com/darkoatanasovski/dynamic-routes-with-edge-runtime
To Reproduce
Note: To reproduce this bug, you need to set runtime to edge in your
next.config.js
and deploy it to Vercel's servers. On the local dev server, seems like you can't reproduce the issuee.g.
Describe the Bug
If you try to use appDir and dynamic routes in combination with
edge runtime
, there is an issue with parsing the path parameters which is not the case innodejs runtime
. So, the bug here is that you can't access the params likeparams.paramName
e.g.
this works in
nodejs runtime
, but doesn't work inedge runtime
:If you try to access this route [ https://dynamic-routes-with-edge-runtime.vercel.app/items/123 ] server responding with
500 Internal Server Error
But if you try to add query parameter to this route, seems like there is no issue.
e.g.
https://dynamic-routes-with-edge-runtime.vercel.app/items/123?id=123
Also, there are two errors in the logs:
First error:
Second error:
Expected Behavior
to work without adding the query parameter, exactly like in the
nodejs runtime
Which browser are you using? (if relevant)
not relevant
How are you deploying your application? (if relevant)
not relevant
The text was updated successfully, but these errors were encountered: