Next.js Discord

Discord Forum

Error when deploying on vercel.. api not working

Unanswered
Kombai posted this in #help-forum
Open in Discord
KombaiOP
i get this error from vercel

app/api/products/[id]/route.js
Type error: Route "app/api/products/[id]/route.js" does not match the required types of a Next.js Route.
"productHandler" is not a valid Route export field.

this is the file i provide so i can get some products by id..
but i cant find a way to migrate this on a new function for 13.5 nextjs
can anyone help?

2 Replies

Please look at the docs for route handlers in app dir (they have changed significantly from pages dir)
@Kombai have you fixed your question, or is it still open?