Next.js Discord

Discord Forum

Need help with ISR

Unanswered
Sun bear posted this in #help-forum
Open in Discord
Sun bearOP
Hi there iam using this to revalidate a route.

export const revalidate = 43 600;


But it doesn’t work, can somebody help me?

30 Replies

Shy Albatross
by route you actually mean a route or a page?
Shy Albatross
actually I think it's just that 43 600 is not a valid number, try 43600 instead
also,
The values of the config options currently need be statically analyzable. For example revalidate = 600 is valid, but revalidate = 60 * 10 is not.
Shy Albatross
and what do you mean by "it doesn't work", given that 43600 is a pretty strange number to choose?
@Shy Albatross and what do you mean by "it doesn't work", given that 43600 is a pretty strange number to choose?
Sun bearOP
I spent one hole day and the data hasn’t been revalidated
Shy Albatross
did you try starting with something more approachable, like 10 minutes? it's hard to reason about what is happening without seeing the contex o the route you're talking about - is it a static route that you want to revalidate?
https://github.com/cmollinea/calcuplator/blob/main/src/app/page.tsx

This is the page.

Shorty for my code, iam learning by myself web development 😅
Shy Albatross
line 25, you're not awaiting that
oh you're passing a promise, never mind
but why? why not await that and pass just the data?
ok I think the issue might be that you're revalidating the page, but the service getRates that's fetching the data will have its own cache on the fetch itself
you probably want to revalidate the fetch, rather than the page, so use this in the getRates
fetch('https://...', { next: { revalidate: 43200 } })
Shy Albatross
but that strategy is flawed, you would have to time your fetch with the 12h update cycle of the API, so setting your fetch revalidate to 12h makes no sense IMO
if you revalidate a second before the API updates, you'll be waiting another 12h
Wuchang bream
Yes revaluation is not working in Next14 also
I also open an issue on it
@Shy Albatross line 25, you're not awaiting that
Sun bearOP
That’s fine I pass the promise to the component and wait for it there
@Shy Albatross if you revalidate a second before the API updates, you'll be waiting another 12h
Sun bearOP
Mmm I think you got a good point here, maybe 6h will be fine, but it seems to be an issue, so I think I will just fetch in demand for now
@Shy Albatross but why? why not await that and pass just the data?
Sun bearOP
I awaiting for the important ones, and then pass the less important, it make sense to me...
@Wuchang bream I also open an issue on it
Sun bearOP
Ohhh thanks!!!
Shy Albatross
oh nice, old features are broken, new features aren't working too, good release 😅
@Shy Albatross oh nice, old features are broken, new features aren't working too, good release 😅
Sun bearOP
I think this is broken since previous releases, I have one project that isn’t revalidating either in next 13.4