serverless-next.js: 503 The request could not be satisfied.

Describe the bug

image I am using @sls-next/serverless-component@3.1.0-alpha.0. 503 error appears on the pages where getServerSideProps and getStaticProps is used.

Actual behavior

503 request error on cloudFront. where getServerSideProps and getStaticProps is used.

Expected behavior

The package should serve all the pages.

Project structure

Currently, I am using monorepo architecture for my application. The structure of the project is as follows:

  • Root
    • Next app
      • next.config.json
      • node_modules
      • serverless.yml
      • package.json
    • node_modules
    • shared.js
    • package.json
    • cypress

Screenshots/Code/Logs

Serverless.yml : image next.config.json: image

Versions

Checklist

  • You have reviewed the README and FAQs, which answers several common questions.
  • Please first try 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.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18

Most upvoted comments

But I think the real culprit was useServerlesstrace.

image Here is the code in experiment/offline-state-test

@davegariepy @Talhafayyaz11 Talha and I are on the same project. Thank you for the tip that the logs move regions. I found this error: “errorMessage”: “Cannot find module ‘next/dist/next-server/server/node-polyfill-fetch’\nRequire stack:\n- /var/task/pages/experiment/offline-state-test.js\n- /var/task/index.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js”,

Which associates with the client result of:

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. Generated by cloudfront (CloudFront) Request ID: xpniXL5H0B2DzkG1BdbDQkcvMVqBgg7S6A-C-efbZeJ2kvMtE1R-Kg==