Hi all - I'm trying to use the `NextjsSite` constr...
# sst
m
Hi all - I'm trying to use the
NextjsSite
construct with next-auth and hitting some issues I think because Lambda@Edge doesn't support environment variables: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/edge-functions-restrictions.html - so is there a recommendation for using next-auth, which assumes there are NEXTAUTH_URL and NEXTAUTH_SECRET env vars? Can the Lambda@Edge version of the backend be used for only some API requests?
d
This is more likely due to something Next.js related, are you sure you are configuring the env variables correctly? next.config.js: Environment Variables | Next.js (nextjs.org)
m
I'm using env vars in a few places, but will try to find a repro. I've had to do a memoize
getSecretValue
as a workaround which is ok for now but adds a bit of latency to each request. I'll check that it's not something in next.js, but I don't think so because it works fine locally, and the AWS docs explicitly say that env vars aren't supported.