-
-
Notifications
You must be signed in to change notification settings - Fork 460
ISR(Incremental Static Regeneration) feature not generating dynamic pages in s3 bucket #995
Comments
We do have e2e test for fallback page here: Line 38 in 2b9dfd8
You can try here with some random route: https://d2aheyeo29vn1i.cloudfront.net/optional-catch-all-ssg-with-fallback/[random string], first time it will serve fallback page (which is never cached) and then 2nd time (if you hit the same route) it will serve that page I am wondering if you are maybe caching the fallback page causing this behavior? What is your min cache TTL? If you set some min cache in CloudFront, it will force CloudFront to cache that irrespective of cache control header (for fallback it is |
|
Strange, then I am not quite sure what is going on..is there any other error in the console/network tab or perhaps some S3 write permission issue? If you are able, please try to build this component and add logs around here: serverless-next.js/packages/libs/lambda-at-edge/src/default-handler.ts Lines 639 to 660 in 2b9dfd8
|
not getting any error in console. I don't think there is s3 write permission issue because pages are getting stored during the deployment. |
Yes, I was referring to if there is a runtime permission issue of Lambda itself (not AWS key used during deployment, that definitely should be fine) |
Is there any way to debug this issue ? |
I have created new project and deployed it to CloudFront but still same issue build time pages https://d3vk8t6m4jw2vm.cloudfront.net/post/first above two pages are served from s3 // This function gets called at build time
export async function getStaticPaths() {
return {
// Only `/post/first` and `/post/second` are generated at build time
paths: [{ params: { id:'first' } }, { params: {id:'second'} }],
// Enable statically generating additional pages
// For example: `/post/third`
fallback: true,
}
}
// This also gets called at build time
export async function getStaticProps({ params }) {
const post = {'id':params.id};
await new Promise(res => setTimeout(res,3000))
return {
props: { post },
revalidate: 5,
}
}
fallback pages and these pages are not getting stored in s3 and loading on every request |
I did check your link and your fallback page for some reason is being cached:
Are you using the latest alpha version? If so, I believe this might have been fixed. I forgot to check which version you were on, in the future please include that so we can verify if it was already fixed. If you are still having the same issue on latest version, I am not sure what is going on, so either:
|
No, I am using 1.18.0 version
|
Thanks again @dphang I have changed version to |
@sls-next/[email protected] I am facing problem with the page revalidation feature of ISR. This issue is with |
It's not supported yet unfortunately... #804 I am working on releasing 1.19 this month and then hopefully we can take it up. Looks like there is a bounty too |
Great, I really appreciate you and waiting for next release. 😊 |
There is! I'm offering a $2000 bounty for ISR support. |
@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. |
Guys I think there is a problem with the permissions to write the generated pages in the bucket (at least in my case seems to be that - I'm currently testing to give manual permissions to the defaultLambda). I'm using:
And Cloudfront fails with 503:
By digging into the cloudfront logs of my edge (in this case Sao Pablo / sa-east-1) I found:
By the way I'm using the CDK Construct (I don't think it changes but commenting any way). |
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); |
Thank, yes, I was about to comment the same :) Thanks! |
Is there a way of solving this outside the CDK Construct scope? |
Is this resolved ? |
@gmontanola what do you mean by "outside the CDK Construct scope"?. The root issue is permissions, let's say, you have to have to grant permissions to the default lambda to write in the bucket. |
This can be closed since #1028 was released. Please help try it out and report any bugs in a new issue. Thanks! |
Updated Version I need help. fallback pages : generated page |
I'm facing the same issue, I was testing with some dumb example creating a new Date() on the staticProps and passing to the component and seeing the time revalidate based on the amount of seconds that I set up, this way is working fine, like it was supposed to. But I'm having the same problem as if the function is not calling the API and refreshing the data, it only happens if I do a new deploy. My dev enviroment is outdated because of that, I was looking and the last data that I have is from yesterday when I had to deploy few things but the data is not being updated I was previously working with the |
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
The text was updated successfully, but these errors were encountered: