Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

303
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!