-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
@sentry/nextjs
throws false
when Sentry.flush()
times out
#3746
Comments
The reason behind this bug was because I wasn't calling The error message ( |
Hi @Vadorequest, I have a similar issue at the moment (natterstefan/next-with-sentry#2).
Where did you add Thanks for your help! |
What you're doing seems legit. Sentry.init() is called in the properties files, and you use the Note that even though I marked this issue with |
Hi, @Vadorequest and @natterstefan. This should be fixed by #3846. Once that's released, can you please remove your workaround and let us know if you're still having problems? Thanks! |
FTR: thanks @lobsterkatie, I can confirm that it works with |
Important Details
How are you running Sentry?
Vercel
Description
When
await Sentry.flush(2000);
is executed, if it times out, Sentry throws an exception. The exception value isfalse
.From the TS doc (sdk.d.ts):
It should return false, not throw false.
This is broken, it shouldn't throw an exception when timing out, as it breaks the code.
It's sort of a shame that the tool meant to help devs make their app more robust actually breaks them.
When encapsulating with
try/catch
it works fine.Using "@sentry/nextjs": "6.6.0". Updating to
6.7.2
to see if it solves the issue.Steps to Reproduce
await Sentry.flush(1);
in a Next.js API endpoint and deploy to Vercel.See PR at UnlyEd/next-right-now#370 (migrating from @sentry/node to @sentry/next.js)
What you expected to happen
It shouldn't throw an exception.
The text was updated successfully, but these errors were encountered: