Skip to content
This repository has been archived by the owner on Jan 28, 2025. It is now read-only.

requires set at least one SSG path in working ISR on AWS #1476

Closed
3 tasks done
laiso opened this issue Aug 1, 2021 · 0 comments · Fixed by #1477
Closed
3 tasks done

requires set at least one SSG path in working ISR on AWS #1476

laiso opened this issue Aug 1, 2021 · 0 comments · Fixed by #1477

Comments

@laiso
Copy link
Contributor

laiso commented Aug 1, 2021

Issue Summary

  1. The hasISRPages flag in the Deployment flow is based on the NonDynamicSSG in the manifest.
  2. however, triggerStaticRegeneration() will be called if 'revalidate' is setted even for DynamicSSG-only pages.
  3. CloudFront returns 503 error page because there is no dependent SQS resource and regeneration-handler function

Actual behavior

503 ERROR
The request could not be satisfied.

The Lambda function associated with the CloudFront distribution is invalid or doesn't have the required permissions. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.

Expected behavior

ISR should work with my component

Steps to reproduce

I have created and tested the following Page component.

// pages/[slug].js

export default function Page() { 
  return (<div></div>)
}

export async function getStaticPaths() {
  return {
    paths: [],
    fallback: true,
  };
}

export async function getStaticProps({ params }) {
  return {
    props: {
      date: (new Date()).toString(),
      slug: params.slug,
    },
    revalidate: 60,
  }
}

Screenshots/Code/Configuration/Logs

It reminded of me the problem reported at #1098.

At this time, the default-handler of CloudWatch Logs had the following output.

{
    "errorType": "AWS.SimpleQueueService.NonExistentQueue",
    "errorMessage": "The specified queue does not exist for this wsdl version.",
    "Type": "Sender",
    "Code": "AWS.SimpleQueueService.NonExistentQueue",
    "Detail": "",
    "name": "AWS.SimpleQueueService.NonExistentQueue",
    "$fault": "client",
    "$metadata": {
        "httpStatusCode": 400,
        "requestId": "6a0ae010-953f-55e7-9b33-b96fe51a7531",
        "attempts": 1,
        "totalRetryDelay": 0
    },
    "stack": [
        "AWS.SimpleQueueService.NonExistentQueue: The specified queue does not exist for this wsdl version.",
        "    at /var/task/index-94ce7346.js:2068:68",
        "    at step (/var/task/serdePlugin-6d615471.js:91:23)",
        "    at Object.next (/var/task/serdePlugin-6d615471.js:72:53)",
        "    at fulfilled (/var/task/serdePlugin-6d615471.js:62:58)",
        "    at processTicksAndRejections (internal/process/task_queues.js:95:5)"
    ]
}

Versions

  • OS/Environment: macOS 11.5
  • @sls-next/serverless-component version: git: a5d74d2
  • Next.js version: v11.x latest

Additional context

point of

$ jq . < .serverless_nextjs/default-lambda/manifest.json

"ssg": {
  "dynamic": {
    "/[slug]": {
      "fallback": "/[slug].html"
    }
  },
  "nonDynamic": {
    "/": {
      "initialRevalidateSeconds": false,
      "srcRoute": null
    }
  },
  "notFound": {}
}

Checklist

  • You have reviewed the README and FAQs, which answers several common questions.
  • You have reviewed our DEBUGGING wiki and have tried your best to include complete information and reproduction steps (including your configuration) as is possible.
  • You have first tried using the most recent latest or alpha @sls-next/serverless-component release version, which may have already fixed your issue or implemented the feature you are trying to use. Note that the old serverless-next.js component and the serverless-next.js plugin are deprecated and no longer maintained.

Workaround

Add one dummy path of any kind and deploy again.

export async function getStaticPaths() {
  return {
    paths: [{params: {slug: '_'}}],
    fallback: true,
  };
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant