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

235
Visualizações
TypeError: Cannot read property 'getToken' of undefined in Firebase App Check - Help needed

I have updated Firebase to the latest v9 and as per the docs I am using compat in my import statements.

When I deploy my app to Vercel, deployment is a success. However I have also added app-check based on this answer from Firebaser @Frank van Puffelen https://stackoverflow.com/a/51393449/2772415, in response to a previous question. Now however when I try to deploy my app, deployment fails with the following error... TypeError: Cannot read property 'getToken' of undefined at AppCheckService.activate (/vercel/path0/node_modules/@firebase/app-check-compat/dist/index.cjs.js:70:82)

I have installed App-check as per the documentation, I have set up google reCAPTCHA v3 also as per the docs, so I'm not sure what I'm doing wrong.

Has anyone encountered similar errors with App-checker? I am using Firebase real time database for some context.

Any help is greatly appreciated.

import firebase from 'firebase/compat/app';

import 'firebase/compat/database'
import 'firebase/compat/app-check'

const config = {
  apiKey: process.env.FIREBASE_API_KEY,
  authDomain: process.env.FIREBASE_AUTH_DOMAIN,
  databaseURL: process.env.FIREBASE_DATABASE_URL,
  projectId: process.env.FIREBASE_PROJECT_ID,
  storageBucket: process.env.FIREBASE_STORAGE_BUCKET,
  messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID
};

if (!firebase.apps.length) {
  firebase.initializeApp(config);

  const appCheck = firebase.appCheck();
  // Pass your reCAPTCHA v3 site key (public key) to activate(). Make sure this
  // key is the counterpart to the secret key you set in the Firebase console.
  appCheck.activate(
    process.env.GOOGLE_APP_CHECK_SITE_KEY,

    // Optional argument. If true, the SDK automatically refreshes App Check
    // tokens as needed.
    true);
}

const database = firebase.database();

export { firebase, database as default };
about 4 years ago · Juan Pablo Isaza
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