Skip to content
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

feat(nuxt/nitro): Flush with waitUntil after response #13895

Closed
wants to merge 3 commits into from

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Oct 7, 2024

When deploying a Nuxt page to Vercel, Sentry can capture events but the server instance is closed too early. With waitUntil, Vercel can wait for Sentry to flush all events.

@s1gr1d s1gr1d requested review from lforst and Lms24 October 7, 2024 14:36
@@ -29,10 +29,16 @@ export default defineNitroPlugin(nitroApp => {
captureContext: { contexts: { nuxt: structuredContext } },
mechanism: { handled: false },
});

vercelWaitUntilAndFlush();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we have to await waitUntil or am I misunderstanding how this should work?

Copy link
Member

@lforst lforst Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

waitUntil is a worker API that simply tells the runtime not to freeze execution until the passed promise has resolved. So no need to await it. (awaiting would probably even be bad because it would block the response?)

@s1gr1d
Copy link
Member Author

s1gr1d commented Oct 15, 2024

Can be closed in favor of this PR: #13986

@s1gr1d s1gr1d closed this Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants