H3 · Migration
vite-doctor/h3migrationerrorSuggestion
Why it happens
H3 v2 no longer exports these names. Importing a removed value fails when the module loads, and importing a removed type fails the typecheck.
Fix
Use the replacement the H3 migration guide names, such as returning the value instead of send() or throwing an HTTPError instead of sendError().
Example
Return the response body
Before
import { defineHandler, send } from "h3"
export default defineHandler((event) => {
return send(event, "ready")
})
After
import { defineHandler } from "h3"
export default defineHandler(() => {
return "ready"
})
Type the app as H3
Before
import type { App } from "h3"
export function mount(app: App) {}
After
import type { H3 } from "h3"
export function mount(app: H3) {}
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/migration/no-removed-exports