H
Hono4mo ago
jay

Next.js 15.0.0 "FetchEventLike" type error

Hi, I’m trying to use Hono with Next.js 15 App Router and Auth.js. Everything works fine when I run pnpm dev, but when I run pnpm build, I encounter a type error (screenshot attached).
src/app/api/[[...route]]/route.ts
Type error: Route "src/app/api/[[...route]]/route.ts" has an invalid "GET" export:
Type "FetchEventLike" is not a valid type for the function's second argument.
src/app/api/[[...route]]/route.ts
Type error: Route "src/app/api/[[...route]]/route.ts" has an invalid "GET" export:
Type "FetchEventLike" is not a valid type for the function's second argument.
package.json version:
"hono": "^4.6.6",
"@hono/auth-js": "^1.0.12",
"next": "15.0.0",
"@auth/core": "^0.37.2",
"hono": "^4.6.6",
"@hono/auth-js": "^1.0.12",
"next": "15.0.0",
"@auth/core": "^0.37.2",
I’ve been following one of CodewithAntonio’s YouTube tutorials, but I’m stuck at this point. Any clues or advice would be greatly appreciated!
No description
1 Reply
jay
jayOP4mo ago
I guess yusukebe will fix this error! https://github.com/honojs/hono/issues/3548
GitHub
Next.js 15: `Type "FetchEventLike" is not a valid type for the func...
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, o...

Did you find this page helpful?