Ask questions"API resolved without sending a response" false positive

Bug report

Describe the bug

next api route logs

API resolved without sending a response for /graphql, this may result in stalled requests.

even though it sends a response;

To Reproduce

Set up a route like:

// /api/graphql.ts
import { createProxyMiddleware } from 'http-proxy-middleware';

export const config = {
  api: {
    bodyParser: false

export default createProxyMiddleware({
  target: process.env.API_ENDPOINT,
  pathRewrite: { '^/api': '' }

And call it from the browser

Expected behavior

No unnecessary warning messages

System information

  • Version of Next.js: 9.2.2

Answer questions jamesmosier

Is this answer perhaps helpful?

"[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"

Github User Rank List