H3 · Migration
vite-doctor/h3migrationerrorSuggestion
Why it happens
H3 v2 merged the router into the app. The removed members are undefined at runtime, so a call throws when the route module loads and the server fails to start.
Fix
Register routes with app.on(method, path, handler) or app.get(path, handler), register each path separately, and wrap lazy handlers with defineLazyEventHandler().
Example
Register routes on the app
Before
const router = createRouter()
router.add("/items", listItems)
app.use(router)
After
app.get("/items", listItems)
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-router-api