Not Getting updated data on the deployed version.
Answered
Scottish Fold posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/1.png)
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
![Image](https://cdn.discordapp.com/attachments/1127948028574175233/1127948029173964892/next.png)
3 Replies
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/f386ac21405ce3442e0f3598223e1cb3.webp?size=256)
joulev
export const dynamic = 'force-dynamic'
Answer
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/f386ac21405ce3442e0f3598223e1cb3.webp?size=256)
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](https://cdn.discordapp.com/embed/avatars/1.png)
Scottish FoldOP
Yeah it works now, Thanks a ton!