Next.js Discord

Discord Forum

Not Getting updated data on the deployed version.

Answered
Scottish Fold posted this in #help-forum
Open in Discord
Avatar
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
Image
Answered by joulev
export const dynamic = 'force-dynamic'
View full answer

3 Replies

Avatar
joulev
export const dynamic = 'force-dynamic'
Answer
Avatar
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
Avatar
Scottish FoldOP
Yeah it works now, Thanks a ton!