Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

134
Visualizações
Firebase secrets not defined in process.env

I'm writing a Firebase function with Cloud Storage trigger. Like this

const functions = require('firebase-functions')
const doSomethingWithSecrets = require('./doSomethingWithSecrets')

const doSomethingWhenUploaded = functions.runWith({
  secrets: ["MY_SECRET_1", "MY_SECRET_2", "MY_SECRET_3"]
}).storage.object().onFinalize(o => {
  functions.logger.debug([
    process.env.MY_SECRET_1  // undefined
    process.env.MY_SECRET_2  // undefined
    process.env.MY_SECRET_3  // undefined
  ])

  doSomethingWithSecrets(process.env.MY_SECRET_1, process.env.MY_SECRET_2, process.env.MY_SECRET_3)
  // Error: Invalid secret.
})

All three of them returns undefined. I've made sure that they're properly set. They show up both when using firebase functions:secret:accesss MY_SECRET_1 and in Google Cloud Console.

What's wrong?

Additional info

I previously used it with only one secret and it worked. I don't know what happened, I'm using nvm and lost track of which Node version I used when it worked, so it may be a clue.

process.env returns all the env like normal and none of my secrets shows up.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Update your firebase-tools and the issue will resolve itself. I was dealing with this issue all day today and found a git hub issue that fixed the problem in the latest release of 10.9.2.

npm install -g firebase-tools

https://github.com/firebase/firebase-tools/issues/4540 https://github.com/firebase/firebase-tools/issues/4459

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda