Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ref(nextjs): Remove dead code #13903

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

lforst
Copy link
Member

@lforst lforst commented Oct 8, 2024

Cleans up the instrumentation for pages router API routes and removes some dead code.

@lforst lforst marked this pull request as ready for review October 8, 2024 09:12
@lforst lforst requested a review from chargome October 8, 2024 09:12
consoleSandbox(() => {
// eslint-disable-next-line no-console
console.warn(
'[sentry] If Next.js logs a warning "API resolved without sending a response", it\'s a false positive, which may happen when you use `wrapApiHandlerWithSentry` manually to wrap your routes. To suppress this warning, set `SENTRY_IGNORE_API_RESOLUTION_ERROR` to 1 in your env. To suppress the nextjs warning, use the `externalResolver` API route option (see https://nextjs.org/docs/api-routes/api-middlewares#custom-config for details).',
Copy link
Member Author

Choose a reason for hiding this comment

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

For the record, this was necessary some time ago because we used to monkeypatch res.end() with an async method, delaying the actual .end() call until we had flushed the event because of Vercel lambdas freezing. This caused the warning emitted by Next.js that the log message talks about.

Since nowadays we have waitUntil(), we don't need async .end()s and therefore this log message.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants