H3 · Responses
vite-doctor/h3responseerrorSuggestion
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