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

Using callbacks in an API page throws "API resolved without sending a response" #11432

Closed
mattcarlotta opened this issue Mar 28, 2020 · 2 comments

Comments

@mattcarlotta
Copy link
Contributor

mattcarlotta commented Mar 28, 2020

Bug report

When using middleware callbacks in an API page, the warning: API resolved without sending a response for /api/signedin, this may result in stalled requests is thrown despite a response always being returned.

To Reproduce

Within an API page, add middleware callback functions -- which take some time to resolve -- that wrap the final destination function.

Reproducible example (codesandbox is a bit wonky and not show the warning, so it'll require an additional refresh within the Browser tab and waiting a few seconds before it displays -- check Terminal for warning):
Edit API Callback Warning

In case of the codesandbox not working, here's a screenshot (this example somewhat mimics a local repo I'm currently working on, which throws the same warnings):
6MBscsA.png.

Expected behavior

Not to throw a warning.

System information

  • OS: Ubuntu 18.04 LTS
  • Browser: Chrome
  • Version of Next.js: 9.3.2

Additional context

Wrapping each callback function within a Promise, as mentioned here, doesn't seem to suppress the warning.

@lfades
Copy link
Member

lfades commented Mar 28, 2020

Known issue, we currently thinking on a solution for this. Closing as duplicated of #10589 and #10777

@lfades lfades closed this as completed Mar 28, 2020
@balazsorban44
Copy link
Member

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.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants