firebase-framework-tools icon indicating copy to clipboard operation
firebase-framework-tools copied to clipboard

[ISR] Revalidate property doesn't work on getStaticProps

Open fortulyapps opened this issue 3 years ago • 1 comments

I'm trying to create a page that have static pages but should rebuild the page after some time (using the "revalidate" property). I was testing if is working hosting on Firebase, but that doesn't seems to work properly, because after the first generation, never rebuild again.

Here is the code I used to test:

export function getStaticProps() { let randomNumber = Math.random(); console.log("Random number generated: " + randomNumber);

return {
    revalidate: 10, // secs
    props: {
        number: randomNumber,
    }
}

}

export default function randomnum(props) { return (

Random number: {props.number}

) }

Are you planning to fix this? Maybe with a function similar to the ssr function, but for SSG (where it will check for revalidate properties).

fortulyapps avatar Oct 14 '22 20:10 fortulyapps

Sorry about that, we missed a TODO while we were moving the code into firebase-tools. We'll get this addressed shortly.

jamesdaniels avatar Oct 20 '22 18:10 jamesdaniels

Working on this and the Next 13 fixes here https://github.com/firebase/firebase-tools/pull/5175

jamesdaniels avatar Oct 28 '22 04:10 jamesdaniels

Fixed in the latest CLI release

jamesdaniels avatar Nov 02 '22 21:11 jamesdaniels