0

I'm working on a Next.js 15 App Router project with a POST API route located at app/api/users/webhook/route.ts. In production (on Vercel), the build and API route work perfectly. But locally, when I run npm run build, I get this error:

TypeError: Cannot read properties of undefined (reading 'query')
    at new nH (.next/server/app/api/users/webhook/route.js:40:4398)
    at nJ.createSession (...)
    ...
Error: Failed to collect page data for /api/users/webhook

package.json

I'm using bun locally but running npm in CI and Vercel:

"scripts": {
  "build": "next build",
  ...
}
1
  • Please provide enough code so others can better understand or reproduce the problem. Commented Jun 30 at 14:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.