Calling Sentry.flush()
with @sentry/node
always throws an exception on Next.js API endpoints
#3748
Closed
5 of 9 tasks
Labels
Package: nextjs
Issues related to the Sentry Nextjs SDK
Package + Version
@sentry/browser
6.3.6@sentry/node
6.3.6raven-js
raven-node
(raven for node)Version:
Description
It's recommended by Next.js to call
Sentry.flush()
manually, before returning an HTTP response from API endpoints.But, it doesn't work so well. When calling the API endpoint, it doesn't send the error to Sentry and fails with
[flushSafe] An exception was thrown while running Sentry.flush()
. (see implementation below)The timeout being used is
5000
, which is more than what's recommended (2000
).What's also weird is that I wasn't flushing before and it was working (at least sometimes) but now it always fails.
The text was updated successfully, but these errors were encountered: