0

Does anyone know how to use global config for Nextjs?, I'm using the new App Router (./app), before this new router this code worked

constants.ts file

export const REVALIDATE_ITERATIONATION: number = 1800

page.tsx file

export const revalidate = REVALIDATE_ITERATIONATION

but with new router, on the last one I'm getting this error: "REVALIDATE_ITERATIONATION" is not a valid value for the "revalidate" option. The configuration must be statically analyzable. 58:27:21 typescript71003

I'd like to use a global config for all my pages revalidation param but have not been lucky yet

the only thing that works right now for me is to write the same value every revalidate param like the documentation says

export const revalidate = 1800

0 Answers0