Next.js 15: `Type "FetchEventLike" is not a valid type for the function's second argument.`
Closed this issue · 2 comments
What version of Hono are you using?
4.6.5
What runtime/platform is your app running on?
Node/Vercel
What steps can reproduce the bug?
☝️ The above error occurs when upgrading to Next.js 15. This, of course, uses hono/vercel
's handler with the Route Handler convention. Example:
import { api } from '@repo/api/hono';
import { handle } from 'hono/vercel';
export const DELETE = handle(api);
export const GET = handle(api);
export const POST = handle(api);
export const OPTIONS = handle(api);
Like the error indicates, it has to do with the FetchEventLike
type from Hono:
hono/src/adapter/vercel/handler.ts
Lines 5 to 9 in 3d8abbc
I don't know if simply removing the requestContext
argument along with its type is sufficient, but when I remove it locally and try to build all seems to work just fine. I don't see anything in the Route Handlers documentation that says it can't be removed, but I defer to the maintainers.
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
I'm using this in a monorepo context, for clarity, but I don't think that's relevant for this specific error.
This is a bug. I'll fix it.
@yusukebe Could you please release a new version soon? 🙏🏻