We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For a NextjsSite, the SST docs state that you can add error response pages: https://docs.sst.dev/constructs/NextjsSite#cdkdistribution. However, it doesn't work.
const site = new NextjsSite(stack, 'MySite', { customDomain: setCustomDomain(stack), cdk: { distribution: { defaultBehavior: { viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS, allowedMethods: AllowedMethods.ALLOW_ALL, }, errorResponses: [ { httpStatus: 400, responseHttpStatus: 200, responsePagePath: '/index.html', ttl: Duration.minutes(10), } ], httpVersion: HttpVersion.HTTP2_AND_3, }, }, });
After much digging, we discovered that the errorResponses array is being ignored. PR #3735 addresses that change and allows it to work again.
errorResponses
If that change isn't approved, then the documentation and TS types need to updated.
The workaround for now is this:
const site = new NextjsSite(stack, 'MySite', { customDomain: setCustomDomain(stack), cdk: { transform: (plan) => { plan.errorResponses = [ { httpStatus: 400, responseHttpStatus: 200, responsePagePath: '/index.html', ttl: Duration.minutes(10), }, ]; }, distribution: { defaultBehavior: { viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS, allowedMethods: AllowedMethods.ALLOW_ALL, }, httpVersion: HttpVersion.HTTP2_AND_3, }, }, });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
For a NextjsSite, the SST docs state that you can add error response pages: https://docs.sst.dev/constructs/NextjsSite#cdkdistribution. However, it doesn't work.
After much digging, we discovered that the
errorResponses
array is being ignored. PR #3735 addresses that change and allows it to work again.If that change isn't approved, then the documentation and TS types need to updated.
The workaround for now is this:
The text was updated successfully, but these errors were encountered: