Not Getting updated data on the deployed version.
Answered
Scottish Fold posted this in #help-forum
Scottish FoldOP
I have created a Next.js app with Prisma as ORM for my PostgreSQL database.
The routes on source, gives the updated data in development mode. But the deployed version (on vercel) return that data without the latest data.
The database has the updated data.
Any reason why this could happen
The routes on source, gives the updated data in development mode. But the deployed version (on vercel) return that data without the latest data.
The database has the updated data.
Any reason why this could happen
3 Replies
joulev
export const dynamic = 'force-dynamic'
Answer
joulev
the behaviour you observed is the static generation feature of route handler; you have to make it dynamic to always get fresh data https://nextjs.org/docs/app/building-your-application/routing/router-handlers#static-route-handlers
Scottish FoldOP
Yeah it works now, Thanks a ton!