#Elisei - invalid_request_error

1 messages ยท Page 1 of 1 (latest)

atomic acorn
rich grail
#

Maybe I need to add some NEXT_SK in front of defined variable (STRIPE_SECRET_KEY) ?

#

Currently I have:

atomic acorn
#

In your client side code, how are you loading your public key?

rich grail
#

Maybe I need to hardcode this one instead of process.env?

atomic acorn
#

You can to test it now, but you should not need to hard code this. That error message implies that the variable is undefined when you try to load it.

#

Can you load other variables from process.env?

rich grail
#

Yep, I think other variables work fine, ex login one

#

Login with discord works well.

atomic acorn
#

Is it possible that your code is working with an old version of this config that doesn't have the NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY?

#

Have you restarted your process since adding this code?

rich grail
#

Do you want to try it without NEXT_PUBLIC_?

atomic acorn
#

It looks like that is part of that variable's name from the code you sent.

rich grail
#

Oke, I'll give it a try ๐Ÿ˜‰

atomic acorn
#

That being said, this is your environmental variable so unfortunately I don't have much insight on the syntax for how you should load it

rich grail
#

It's still not working.

#

But thanks, I'll make some research about that ๐Ÿ˜‰ .

atomic acorn
#

Of course, it looks like the code should work once it has the right key.

#

To debug, I would see if you can load and print another variable from that file and then switch the variable name to the one you are interested in once you can load the other variable properly