Next.js Discord

Discord Forum

Revalidate in components not working?

Unanswered
Chartreux posted this in #help-forum
Open in Discord
ChartreuxOP
I have
export const revalidate = 3600;
export const dynamicParams = true;
in my page.tsx which loads a file list from my db.
They get passed to a client component which shows a number of results.
Also a filelist component gets passed to the client component, which also gets the db result as a prop.

The weird thing: In production the number of results on the client component updates correctly when I add new files, but the fileslist component that gets passed to the client component doesn't update. It works fine in dev mode tho. Am I understanding the revalidate value wrong? I just want the page to be cached and occasionally being updated.

I checked the live version from yesterday and there are now 30 files in the DB and the client component shows "30 files", but the filelist component only lists one.

3 Replies

ChartreuxOP
https://nextjs.org/docs/app/building-your-application/data-fetching/incremental-static-regeneration This has a decent example and explains it, but it is completely missing how this behaves when using components on the page. Do the components also need an revalidate export?
Asiatic Lion
hei, are you finally found the solution? @Chartreux
ChartreuxOP
Not really, no.