Fetching data after Vercel deploy
Hey guys i got a question. I'm just learning to build fullstack app with next.js drizzle and neon. I configured it and everything works fine locally, but after vercel deploy, with same database url connection , it seems to be only fetching on the build time, and when i add records after that it doesnt fetch before redeploy. Why is that happening? I'm using newest version of next. And i just fetch on the page component with simple Thanks for help!
2 Replies
Have you tried building your app locally and run it and see if it does the same effect?
I don't know if we encountered the same bug but I happened to encounter a bug in production where my newly added records appear on my database but the latest data is not getting fetched, which i solved by adding the code below on the page.tsx of the route.
Next.js by default statically renders every route so, by adding that code it makes the component dynamic.