#tyler_code

1 messages ¡ Page 1 of 1 (latest)

unkempt nimbusBOT
#

👋 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.

thin mantle
#

Hi! How are you storing your environment variables on Nextjs?

distant wave
#

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."

thin mantle
distant wave
#

ENV variables are correct also on hosting platform

#

Sadly I saw that form already and tried those methods

thin mantle
#

What do you see if you look at the contetnts of process.env in prod?

distant wave
#

Yeah i checkout that post also

#

and tried those things

#

thats why im stumped

thin mantle
#

What do you see if you look at the contetnts of process.env in prod?

distant wave
#

like in server logs or in console?

thin mantle
#

yes lolz

distant wave
#

Server logs

thin mantle
#

Like do a console.log(process.env)

distant wave
#

and Console

thin mantle
#

Can you successfully acces other env variables loaded in by AWS Amplify?

distant wave
#

Yes

#

Only Stripe api key giving issue

thin mantle
#

What version of stripe-node?

distant wave
#

"stripe": "^17.6.0",

#

"@stripe/react-stripe-js": "^3.1.1",
"@stripe/stripe-js": "^5.5.0",

thin mantle