Dynamic route at pages level leds request for public resources to 503 Error
See original GitHub issueDescribe the bug
When dynamic route is at pages level (e.g. pages/[lang]/index.jsx) public folder content return a 503 Error: “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.”
Actual behavior
When getStaticPaths is being used on a root level dynamic route (pages/[lang]/index.jsx), public folder or any not generated request that is issued at that level (www.example.com/foo), respond 503
Expected behavior
Public resources should be served correctly, and all the not generated request at root level should respond with a 404 page
Steps to reproduce
Put a dynamic route at root level /pages/[lang]/index.jsx with getStaticPaths and a public folder with favicon and the favicon is not reachable.
Versions
1.18.0-alpha.5
- @sls-next/serverless-component version: 1.18.0-alpha.5
- Next.js version: 9.5.5
Checklist
- You have reviewed the README and FAQs, which answers several common questions.
- Please first try using the latest
@sls-next/serverless-component
release version, which may have already fixed your issue. Note that the oldserverless-next.js
component and theserverless-next.js
plugin are deprecated and no longer maintained.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11
Top GitHub Comments
Supported 404 pages for fallback: false in 1.18.0-alpha.8. Please try and let me know if there are any issues.
May be related to this: https://github.com/serverless-nextjs/serverless-next.js/issues/646. I will take a look this week at both. Was making e2e tests more extensible so it’s easier to add new ones, we will add tests for these cases so it shouldn’t break in the future once fixed.