7

How to deploy ISR build folder in next js to firebase? I migrate from ssg to isr, currently, I deploy the out folder with export method. Now when I remove (export method (does not support ISR (getStatichPath fallback: true right?) firebase can't detect the index folder...

Any tutorial? How to deploy nextjs with Incremental Static Regeneration? ISR?

What I know is firebase deploy from out folder (SSG)

Firebase settings:

{
  "hosting": {
    "cleanUrls": true,
    "public": "out/",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  },
  "storage": {
    "rules": "storage.rules"
  },
  "firestore": {
    "rules": "firestore.rules",
    "indexes": "firestore.indexes.json"
  }
}

1 Answer 1

1

Incremental Static Regeneration (ISR) is working out of the box with firebase even with a revalidate option. Make sure to follow the guidelines for the firebase/nextjs setup.

export const getStaticProps: GetStaticProps = async () => {
  const props: Props = {
    updatedAt: new Date().getTime(),
  };
  return {
    props: props,
    revalidate: 10, // number of seconds to regenerate the page
  };
};

Once deployed (yarn deploy), data will be updated every 10 seconds

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.