-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
"API resolved without sending a response" false positive #10589
Comments
Is this answer perhaps helpful? #10439 (comment) "[Next] can't detect you are still doing work in the API unless you return a promise and wait to resolve it until after the callback is fired" |
If I forget to send a response, I will notice soon enough because my API wouldn't do anything. No need for a log message, especially not if it can't be correctly calculated when it should apply. Maybe a better heuristic would be to check whether
and then log something like |
This flag is useful when you are using an external API resolver like express when defining an API route, since the native functionality doesn't realize that the API actually sent a response. A very simple use case example https://github.com/PabloSzx/next-external-api-resolver-example fixes vercel#10589
* Add flag to disable API warning This flag is useful when you are using an external API resolver like express when defining an API route, since the native functionality doesn't realize that the API actually sent a response. A very simple use case example https://github.com/PabloSzx/next-external-api-resolver-example fixes vercel#10589 * Update api-middlewares.md Co-authored-by: Tim Neutkens <[email protected]>
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
next api route logs
even though it sends a response;
To Reproduce
Set up a route like:
And call it from the browser
Expected behavior
No unnecessary warning messages
System information
The text was updated successfully, but these errors were encountered: