Still facing the issue JSON.parse: unexpected character at line 1 column 1 of the JSON data
JSON.parse: unexpected character at line 1 column 1 of the JSON data
My key is in the .env.local file
FIREBASE_PRIVATE_KEY={"privateKey":"-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQE...-----END PRIVATE KEY-----"}
and I'm retrieving it like this
const { privateKey } = JSON.parse(process.env.FIREBASE_PRIVATE_KEY);
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Still facing the issue
JSON.parse: unexpected character at line 1 column 1 of the JSON data
My key is in the .env.local file
and I'm retrieving it like this