H3 · Responses

H30010Drop the event argument from H3 v2 response helpers

Flags redirect(), noContent(), html(), and iterable() called with the event as their first argument.

Why it happens

H3 v2 response helpers build a response value and no longer take the event. Passing it shifts every argument: redirect(event, "/login") uses the event as the location, and html(event, markup) renders the event instead of the markup.

Fix

Drop the event argument and return the helper's result, such as return redirect("/login").

Example

Return the helper without the event

Before

export default defineHandler((event) => {
  return redirect(event, "/login")
})

After

export default defineHandler(() => {
  return redirect("/login")
})

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-event-first-arg
Copyright © 2026