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

194
Vistas
Where is 'initializeApp' in firebase imports?

So I started taking a look into firebase and just after defining the intialization as

import firebase from "firebase/compat"

const firebaseConfig = {
   apiKey: process.env.REACT_APP_API_KEY,
   authDomain: process.env.REACT_APP_AUTH_DOMAIN,
   projectId: process.env.REACT_APP_PROJECT_ID,
   storageBucket: process.env.REACT_APP_STORAGE_BUCKET,
   messagingSenderId: process.env.REACT_APP_MESSAGING_SENDER_ID,
   appId: process.env.REACT_APP_APP_ID,
   measurementId: process.env.REACT_APP_MEASUREMENT_ID
};

const chatSupportApp = firebase.initializeApp(firebaseConfig, "my-app");

A wild warning was display!

/*It looks like you're using the development build of the Firebase JS SDK.
When deploying Firebase apps to production, it is advisable to only import
the individual SDK components you intend to use.

For the module builds, these are available in the following manner
(replace <PACKAGE> with the name of a component - i.e. auth, database, etc):

CommonJS Modules:
const firebase = require('firebase/app');
require('firebase/<PACKAGE>');

ES Modules:
import firebase from 'firebase/app';
import 'firebase/<PACKAGE>';

Typescript:
import firebase from 'firebase/app';
import 'firebase/<PACKAGE>';*/

I search in many posts, including documentation and didn't really get how to initialize my app first before using any of the other imports

I found out lately that is was a bit hidden under "firebase/firebase-app"

so it get solved, as

import {initializeApp} from "firebase/firebase-app";

const firebaseConfig = {
    apiKey: ...............
};

const chatSupportApp = initializeApp(firebaseConfig, "my-app");

export default chatSupportApp;

This started as a question that I search in most stack overflow posts, but since I solve it for now somehow I wanted also to share with the community in here, but also consider any other suggestion, the question will be then.

Is this approach correct? why all the documentation suggest to do it with

import { initializeApp } from 'firebase/app'; as:

import { initializeApp } from 'firebase/app';
import { getAuth, onAuthStateChanged, getRedirectResult } from 'firebase/auth';

This really didn't work for me at all and I was not able to use it.

Thanks and enjoy your code!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

import {initializeApp} from "firebase/firebase-app";

const firebaseConfig = {
    apiKey: ...............
};

const chatSupportApp = initializeApp(firebaseConfig, "my-app");

export default chatSupportApp;
about 4 years ago · Juan Pablo Isaza Denunciar
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