Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

302
Vistas
Angular 8 Firestore - TypeError: admin.initializeApp is not a function

I'm trying to set an integration between Angular 8/Firestore and Stripe, following some tutorials. My config.ts file is:

import * as functions from 'firebase-functions';
import * as admin from 'firebase-admin';
admin.initializeApp();

// Initialize Cloud Firestore Database
export const db = admin.firestore();
const settings = { timestampsInSnapshots: true };
db.settings(settings);

// ENV Variables
export const stripeSecret = functions.config().stripe.secret;

// Export Stripe
import Stripe from 'stripe';
export const stripe = new Stripe(stripeSecret, {apiVersion: '2020-08-27' });

Everything looks right but when I'm trying to deploy it, displays the following message:

TypeError: admin.initializeApp is not a function

I've checked firebase-admin versions and also the way I've imported it, but I get the same error. How can I solve this?

UPDATE

I tried to change the way I've imported:

import { initializeApp } from 'firebase-admin';
initializeApp();

But I had another error:

SyntaxError: Named export 'initializeApp' not found. The requested module 'firebase-admin' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using: import pkg from 'firebase-admin'; const { initializeApp } = pkg;

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda