We have configured the Link Resolver in Prismic to point to /api/preview
When we preview on the live URL we are seeing a Cloudfront error for all pages.
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)
Is anyone else using AWS Amplify with Nextjs 11?
As we are using Amplify we haven't set any permissions on the lambda functions as this is all done automatically by AWS.
Unfortunately, I don't have any experience with Amplify, although it seems like an issue related to triggering Next.js's preview mode on AWS.
There's some information about these /api routes here, but I'm not sure if it helps:
/api : Another key feature that Next.js offers is API routes. Any file inside the folder pages/api is mapped to /api/* and will be treated as an API endpoint instead of a page. The default app comes with pages/api/hello.js that provides an API route. You can use this API to interface with any backend service to fetch data.
Hopefully, this article helps to explain how to trigger /api routes.