H3 · Responses

H30011Return the response an H3 v2 helper builds

Flags H3 v2 response helpers such as redirect(), html(), and noContent() whose result is never returned from the handler.

Why it happens

In H3 v2 these helpers only build a response value. A call whose result is dropped sends nothing, so the handler falls through and responds with whatever it returns next.

Fix

Return the helper's result from the handler, such as return redirect("/login").

Example

Return the redirect

Before

export default defineHandler((event) => {
  if (!event.context.user) redirect("/login")
  return "dashboard"
})

After

export default defineHandler((event) => {
  if (!event.context.user) return redirect("/login")
  return "dashboard"
})

Verify the fix

Run only this rule after editing so the report stays focused on the diagnostic you are closing:

pnpm vite-doctor . --rules h3/response/no-discarded-response
Copyright © 2026