Runtime env not being set
See original GitHub issue@sls-next/serverless-component@1.19.0-alpha.45
I currently have a setup that has this nextJS setup for the frontend. But I am using a proxy on the /api
route that proxies through to another external lambda JSON api (Which is up and running, and accessible)
https://github.com/chimurai/http-proxy-middleware
The issue I currently have is that on pages where I am making use of the proxied external api through getServerSideProps
I am getting a The Lambda function associated with the CloudFront distribution is invalid or doesn't have the required permissions.
error.
Has anyone had a similar issue and suggestions for the correct / needed permissions? It seems like a fetch to another lambda (Accessible from my browser) is what causes the issue. Pages that dont make use of any api calls are working fine.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top GitHub Comments
@mattvb91 If you use .env files for your environment variables, Next.js build will fill them in at build time: https://nextjs.org/docs/basic-features/environment-variables
If it’s a plugin you use that requires the env vars, that might or might not work. The reference has to be detectable statically. If it does not work, there’s nothing serverless-next.js can do about it.
@jvarho thanks! never occured to me i can of course build it into my deployment step!! thanks again