Replies: 15 comments 32 replies
-
Hi, thanks! Following the example app, can you confirm you're double-quoting the env var ( In your local environment, you might also try hardcoding the private key in the config. Of course, do not add that to source control. |
Beta Was this translation helpful? Give feedback.
-
I struggled with this for a while, none of the proposed solutions were working for me. I ended up Base64 encoding the private key, and then decoding it when initializing
|
Beta Was this translation helpful? Give feedback.
-
just went through this for about an hour, found what I was doing wrong.
|
Beta Was this translation helpful? Give feedback.
-
For anyone still having troubles, i had replied to a previous comment but it might not be seen.
|
Beta Was this translation helpful? Give feedback.
-
I have also been working on this for an hour! Providing some more detail here in case it helps others. My main problem was not restarting my local server after updating the .env.local file. This is working for me: .env.local - the key is double quoted initAuth.js
This library looks like a great solution overall! |
Beta Was this translation helpful? Give feedback.
-
This still does not work for me on a live enviroment. I use Heroku with these config vars. And I still get this errors. I tried JSON.parse and .replace() both did not work. |
Beta Was this translation helpful? Give feedback.
-
Just throwing this out there for anyone deploying to Render.com... Single quote and parse it with And if you are working locally, the private key value in the |
Beta Was this translation helpful? Give feedback.
-
I ran into this issue and am deploying my application on Kubernetes via GKE. Posting my solution in case anyone else struggles in the future.. I saved the private key in a
No changes needed in my
Note that I do set initial values in my Dockerfile to avoid any
To debug quickly on K8s, I recommend accessing the pod via |
Beta Was this translation helpful? Give feedback.
-
For anyone else running into this error. After trying to replace the
I was able to make it work by simply getting rid of the last
|
Beta Was this translation helpful? Give feedback.
-
I had a problem that when I stringify my private key it was turning /n in //n. In my .env I changed all of the //n back to /n so the env entry looks like:
A few things to note, the entire key needs wrapped in single ' not the normal double " and the \n must remain a \n not a \n in the private key. then when I use the key:
|
Beta Was this translation helpful? Give feedback.
-
For heroku config vars
|
Beta Was this translation helpful? Give feedback.
-
Anyone faced this issue after resolving the parsing issue?
and I'm trying to read it like this
Im using heroku stack 22. Everything works well in localhost |
Beta Was this translation helpful? Give feedback.
-
How do you guys pass either String or undefined there? for me it complains that privateKey can only be string
|
Beta Was this translation helpful? Give feedback.
-
What worked for me is on vercel environment variable. |
Beta Was this translation helpful? Give feedback.
-
In Amazon Beanstalk I needed to add single quote to the environment (double quote is not accepted) |
Beta Was this translation helpful? Give feedback.
-
Hi there,
Thanks for creating this great plugin!
I have been attempting to setup my firebase configuration and have had quite some trouble. I've followed the example (initAuth.js & .env.local) as best as possible, however I run into an error upon authenticating through firebase.
I see this error client side: uncaught (in promise) Error: Received 500 response from login API endpoint: {"error":"Unexpected error."}
And server side I've logged out the error: error in login.js: FirebaseAppError: Failed to parse private key: Error: Invalid PEM formatted message.
I've also read through the issue thread that seems to be related but can't figure out exactly what I've done wrong. Any help would be greatly appreciated!
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions