You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[NextJS] No data being sent from server-side functions #17193
It's configured with a real DSN which hopefully the Sentry team can view the associated data of.
The reproduction is only broken when deployed to Vercel (standard configuration). When running locally data gets sent to Sentry as expected from both client and server code.
When running locally with debug enabled I see that Sentry flushes data a little while after the API request completes. I'm wondering if this issue is only see in Vercel because of the serverless environment being destroyed before flushing happens. NextJS has an after function for scheduling work after a request is finished (https://nextjs.org/docs/app/api-reference/functions/after). Perhaps this isn't being used?
Expect to see logging and errors in the associated Sentry account for production environment. Also expect to see both frontend/backend transactions and spans.
Actual Result
Only logging, errors, transactions, and spans are stored for client-side code, not server-side code.
Ok looks like the lambda is completely freezing and sometimes cuts off the envelope to be sent. In a production app that has some traffic on it this should not have a big effect, but we need to nevertheless fix this. I'll see if we can make use of the after util here, thanks for the hint!
@cbovis thanks again for raising this. The linked PR fixed this issue in my testapp – in case anyone is still running into this issue (especially since the fix will not yet work for turbopack prod builds) please make use of:
import{after}from'next/server';import*asSentryfrom'@sentry/nextjs';exportfunctionGET(){after(()=>{Sentry.flush();});// rest of your handler}
Activity
linear commentedon Jul 28, 2025
JS-783 [NextJS] No data being sent from server-side functions
cbovis commentedon Jul 28, 2025
May be related to #17136
chargome commentedon Jul 29, 2025
Hey @cbovis thanks for providing a repro with that, I'll take a look
chargome commentedon Jul 29, 2025
Ok looks like the lambda is completely freezing and sometimes cuts off the envelope to be sent. In a production app that has some traffic on it this should not have a big effect, but we need to nevertheless fix this. I'll see if we can make use of the
afterutil here, thanks for the hint!chargome commentedon Jul 30, 2025
@cbovis thanks again for raising this. The linked PR fixed this issue in my testapp – in case anyone is still running into this issue (especially since the fix will not yet work for turbopack prod builds) please make use of:
github-actions commentedon Jul 31, 2025
A PR closing this issue has just been released 🚀
This issue was referenced by PR #17223, which was included in the 10.0.0 release.