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

194
Visualizações
'Cannot read property 'apps' of undefined' in nuxtJs/ firebase

I have tried to integrate firebase with Nuxt Js and i am getting this error

enter image description here

As per documentation first I have installed firebase with help of "npm install firebase" and then i have installed "npm install @nuxtjs/firebase" and third i have integrated my firebase config in modules in nuxt.config.js

enter image description here

so whats the solution to solve the above error? Thanks in advance

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

0

It depends on which version of @nuxtjs/firebase you are using, because this package @nuxtjs/firebase is not compatible with firebase version 9+ supporting tree-shaking.

So you need to downgrade you package to firebase version 8 and prior.

For more information, please check the authors github issues.

about 4 years ago · Juan Pablo Isaza Relatório

0

If you are using the new Modular SDK v9.0.1 you might get the above error as it does not use firebase. namespace now, Try using getApps() instead of firebase.apps.

import { initializeApp, getApps } from "firebase/app" 
import { getFirestore } from "firebase/firestore"
import { getAuth } from "firebase/auth" 
const firebaseConfig = {...} 
if (!getApps().length) {
 //.... 
} 
const app = initializeApp(firebaseConfig) 
const db = getFirestore(app) 
const auth = getAuth(app) export {db, auth}
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