#tyler_code
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1340002992623190047
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- tyler_code, 1 day ago, 12 messages
Hi! How are you storing your environment variables on Nextjs?
I'm running a Next.js app on AWS Amplify, and I'm experiencing issues with environment variables not being passed correctly during the build phase. The environment variable STRIPE_SECRET_KEY works locally but fails in production. The error Error: Neither apiKey nor config.authenticator provided. occurs. I've double-checked that the variable is set correctly in AWS Amplify's environment settings, but it doesn't seem to be accessible at build time. Has you faced a similar issue with AWS Amplify / other hosting platforms and Next.js, and how did you resolve it?
Does not work in Prod
apiVersion: "2025-01-27.acacia" as never,
typescript: true,
});```
Works in prod (with actual secret key)
```export const stripe = new Stripe(
"Hard coded secret key",
{
apiVersion: "2025-01-27.acacia" as never,
typescript: true,
},
);```
Ive been doing debugging and server logs also state "Error: Neither apiKey nor config.authenticator provided."
Hi there! I'm not familiar with this, but I did find: https://github.com/stripe/stripe-js/issues/667
ENV variables are correct also on hosting platform
Sadly I saw that form already and tried those methods
What do you see if you look at the contetnts of process.env in prod?
What about this? https://github.com/stripe/stripe-node/issues/2207
What do you see if you look at the contetnts of process.env in prod?
like in server logs or in console?
yes lolz
Like do a console.log(process.env)
Can you successfully acces other env variables loaded in by AWS Amplify?
What version of stripe-node?
"stripe": "^17.6.0",
"@stripe/react-stripe-js": "^3.1.1",
"@stripe/stripe-js": "^5.5.0",
https://github.com/stripe/stripe-node/issues/2207#issuecomment-2547261289 seems to be the solution, as this seems to be a known issue.