Environment
Nitro v3.0.260610-beta
Vite v8.0.16
Node.js v24.16.0
Reproduction
Simply copy and pasting this code into a route (e.g. routes/api/index.ts):
import { defineHandler } from "nitro";
export default defineHandler((e) => {
return { api: 'works!' }
})
should throw an error about EventHandlerRequest not being named without a reference to h3 types (full error below)
My tsconfig:
Describe the bug
When using the define helper for a handler, TypeScript throws the error below.
I would help fix the issue, but I'm not sure if the problem lies within h3 or Nitro.
Additional context
No response
Logs
The inferred type of 'default' cannot be named without a reference to 'EventHandlerRequest' from '.pnpm/h3@2.0.1-rc.22_crossws@0.4.6_srvx@0.11.16_/node_modules/h3'. This is likely not portable. A type annotation is necessary.
Environment
Nitro v3.0.260610-beta
Vite v8.0.16
Node.js v24.16.0
Reproduction
Simply copy and pasting this code into a route (e.g.
routes/api/index.ts):should throw an error about
EventHandlerRequestnot being named without a reference to h3 types (full error below)My tsconfig:
Describe the bug
When using the define helper for a handler, TypeScript throws the error below.
I would help fix the issue, but I'm not sure if the problem lies within h3 or Nitro.
Additional context
No response
Logs