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