Ibra
Ibra

Reputation: 1072

How to Deploy NextJs SSR app on Amplify with Lambda@Edge (503 Error)

I'm currently able to build and deploy Next.js app on Amplify where it automatically detects my .yml file in the root directory and automatically creates resources(Default Edge Lambda, Cloudfront Distribution, S3 bucket) to facilitate the hosting and deployment. I then deployed the function to LambdaEdge using existing CloudFront trigger, ensured all admin permissions are open on the service role associated for this distribution. Let me know what am I missing here.

The Error: The Lambda function associated with the CloudFront distribution is invalid or doesn't have the required permissions. UPDATE: This is a generic error, looking at the Cloud watch log, you will see a failed attempt of initializing firebase credentials and I the error is there. Environment variables are not supported in Lambda@Edge Functions.

CloudFront Error 503enter image description hereenter image description hereenter image description hereenter image description here

Upvotes: 5

Views: 1472

Answers (1)

alacret
alacret

Reputation: 639

This was happening to me on [email protected], After testing many many things, I just downgraded the version to [email protected] and it started working normally.

REF: https://github.com/aws-amplify/amplify-hosting/issues/2175

Upvotes: 1

Related Questions