question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ISR(Incremental Static Regeneration) feature not generating dynamic pages in s3 bucket

See original GitHub issue

pages are generated in s3 on this folder[static-pages/{**}.html and _next/data/{id}/*.json] build time only

when I open url like page/3 in my browser it’s always show me loading state then comes up main content and this page is not being generated in s3

function Post({ post }) {
  const router = useRouter()
  if (router.isFallback) {
    return <div>Loading...</div>
  }

  // Render post...
}

// This function gets called at build time
export async function getStaticPaths() {
  return {
    // Only `/posts/1` and `/posts/2` are generated at build time
    paths: [{ params: { id: '1' } }, { params: { id: '2' } }],
    // Enable statically generating additional pages
    // For example: `/posts/3`
    fallback: true,
  }
}

// This also gets called at build time
export async function getStaticProps({ params }) {
  const res = await fetch(`https://.../posts/${params.id}`)
  const post = await res.json()

  return {
    props: { post },
    revalidate: 5,
  }
}

export default Post

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:24

github_iconTop GitHub Comments

6reactions
dphangcommented, Apr 19, 2021

@adamelmore great! That definitely sounds like a good incentive! I would do myself but unfortunately don’t have enough time to take it on yet until I finish existing bugs / releasing 1.19 (I don’t really need the financial incentive myself). But if someone is interested they can start on it and join our Slack. I agree it is an important feature in Next.js but I think it definitely requires several days work to make sure it is well tested.

I will probably try to put that in one of the pinned issues for more visibility.

2reactions
kirknesscommented, May 2, 2021

Hi @ignaciolarranaga, this will be fixed in #1028, although you can solve right now using something like:

const myApp = new NextJSLambdaEdge()
myApp.bucket.grantReadWrite(myApp.defaultNextLambda);
Read more comments on GitHub >

github_iconTop Results From Across the Web

A Complete Guide To Incremental Static Regeneration (ISR ...
Below you'll find a guide to ISR — including use cases, demos and tradeoffs. The Problem with Static-Site Generation #. The idea behind...
Read more >
Incremental Static Regeneration - Data Fetching - Next.js
Learn how to create or update static pages at runtime with Incremental Static Regeneration. ... Incremental Static Regeneration (ISR) enables you to use ......
Read more >
NextJS Incremental Static Generation and Regeneration ...
Incremental Static Regeneration brings the best of Static Site Generation (SSG) and Server Side Rendering (SSR) to NextJS. The feature ...
Read more >
Incremental Static Regeneration – Vercel Docs
Incremental Static Regeneration (ISR) allows you to create or update content without redeploying your site. ISR has three main benefits for developers: ...
Read more >
Deploying nextjs app as an SPA? : r/reactjs - Reddit
Incremental Static Regeneration (ISR)? Update static page after ... How do I deploy next.js app as an SPA on Cloudfront CDN + S3...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found