H3 · H30010

Drop the event argument from H3 v2 response helpers

Flags redirect(), noContent(), html(), and iterable() called with the event as their first argument.
H30010vite-doctor/h3responseerrorSuggestion

Run this rule

pnpm vite-doctor . --rules h3/response/no-event-first-arg

Why it matters

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.

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")
})
Copyright © 2026