Failed to load env from /home/node/.env RangeError: Maximum call stack size exceeded #70799
Unanswered
jordanallenlewis
asked this question in
Help
Replies: 1 comment
-
were you able to figure this out? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Hey all, getting the below error in my NextJS 14 application which uses NextAuth 15 beta. Its failing to load the .env file which contains my NextAuth environment variables. Google searches suggest it could be an infinite loop related to my env variables referencing each other, but I havent found where that would be and this error does not appear when running locally, only in prod.
Error:
Situation:
I only receive this error when deploying through my companies automated deployment pipelin.
I do not receive this error when running my project locally with
npm run dev
ornpm run build + npm start
I added console.log statements to print the environment variables from my .env and those print the values as expected when the
npm run build
process happens. So this is happening specifically whennpm start
is executed in the prod environment.One idea I had is: My DevOps team recently added the nextauth secrets in the .env file as a Jenkins environment variable, which I am planning on using so that I dont have sensitive values hardcoded in the project itself. Could that be causing the error? And if so, how do I get those values from the Jenkins env variables? Will it still be process.env.* ?
I've attached the files that I think are relevant and removed sensitive values. Thank you in advance!
Dockerfile.txt
env.txt
auth.txt
middleware.txt
package.txt
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions