-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Next.js v12 server side crashing on Vercel #4207
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
Comments
Any ETA on this? Been waiting to upgrade to Next12 for quite some time now and have been blocked because of Sentry. |
I really don't want to be a dick on an open source issue tracker, but this whole thing is just so damn frustrating. It's entirely blocking nextjs@12, for not just us, but also a ton of All the hype around next.js conf – Sentry was a gold sponsor for that – and then it takes two months+ to get the first party integration going, with barely any word, commitment or timeline? … and there I was thinking I'm tracking errors with Sentry, not causing them … Even just an official update/timeline would be appreciated. |
HI @boennemann and everyone else who is impacted by this. Totally justified. We have a fix we hope to put out by the end of business week, pending some peer code review on the following branch. We appreciate that Sentry is important to all our users and customers alike. Apologies for the delay. Your message, and others like yours, are much appreciated and taken very seriously by the team here. https://github.com/getsentry/sentry-javascript/tree/kmclb-nextjs-no-instrumentserver-on-vercel |
@smeubank Thank you very much. Your answer is much appreciated! |
Hello everyone, We have made a change that fixes some issues with the Next.js server when deployed on Vercel. These are available in the latest release, v6.16.1. Could you try this new version and provide any feedback? Thanks! |
Hi @iker-barriocanal 👋 I've tried upgrading to 6.16.1, also removing |
@swudged is this only happening on Vercel? What next.js version are you using? Could you attach the code of your API route, so that we can replicate it? Thanks. |
Thank you for fix this issue. I've tried server side api routes with In our project |
@iker-barriocanal I will find out and report back, currently on holiday for a few days! Thanks |
@iker-barriocanal I've just been bit by this bug after deploying 12 to production. I was coming here to write that even with the latest packages, this is still a problem, but it's actually working. Perhaps there's some delay between a Vercel deploy being marked as completed and the "functions" deploy? At any rate, appears to be working with the below package versions excerpt from package.json
|
@curiousercreative I'm confused after reading your comment, especially:
Are you facing issues when deploying in Vercel with the latest package versions? Is the issue you are facing the same that is described in the issue description? Can you replicate it consistently? |
@iker-barriocanal everything is working, latest packages should be considered a fix. My confusing comment was that I reproduced the issue once after updating packages, likely as a result of client, server, or deploy caches. |
Related to #4103.
The Next.js SDK crashes apps on the server-side when deployed on Vercel. It doesn't happen locally.
Error logs
Cause
This error is caused by importing modules from
next
. In the SDK, this import is required to instrument the server, seesentry-javascript/packages/nextjs/src/utils/instrumentServer.ts
Line 14 in a6c384c
and the server instrumentation is run when initializing the SDK on the server side, see
sentry-javascript/packages/nextjs/src/index.server.ts
Lines 122 to 123 in a6c384c
Solution
On Vercel, the server instrumentation has no effect. Errors and transactions are captured through the custom
_error.js
page and thewithSentry
handler. Not instrumenting the server (to not import any modules fromnext
) when an app is deployed on Vercel should fix the issue, and theVERCEL
environment variable can be helpful here, as used insentry-javascript/packages/nextjs/src/index.server.ts
Line 57 in a6c384c
Technical details may be more complex, to be defined.
The text was updated successfully, but these errors were encountered: