Error: Cannot read properties of undefined (reading 'status')
Answered
Anay-208 posted this in #help-forum
Answered by Ray
https://nextjs.org/docs/pages/building-your-application/routing/api-routes
this link is for page router while you are using app router
this link is for page router while you are using app router
6 Replies
https://nextjs.org/docs/pages/building-your-application/routing/api-routes
this link is for page router while you are using app router
this link is for page router while you are using app router
Answer
for app router, do
return NextResponse.json({ message: 'hello from nextjs' }) insteadhttps://nextjs.org/docs/app/building-your-application/routing/route-handlers
this is the link for app router
this is the link for app router
i know this is solved, but i am assuming that you have changed
page.tsx to route.ts to use route handlers (+ the other fixes Ray suggested)@riský i know this is solved, but i am assuming that you have changed `page.tsx` to `route.ts` to use route handlers (+ the other fixes Ray suggested)
Anay-208OP
Yup, thats what the documentation stated
just checking as others may not realise :)))