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

164
Views
Can't resolve firebase

Hi, I'm trying to do a react clone with firebase backend, but for some reason it can't compile.I get a 'can't resolve firebase' message instead. None of the solutions I've found and employed have worked thus far.

Hi, I'm trying to do a react clone with firebase backend, but for some reason it can't compile.I get a 'can't resolve firebase' message instead. None of the solutions I've found and employed have worked thus far.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It looks like you are using the Firebase SDK 8 code but probably has installed the Firebase SDK 9 version. Your code should look like this with the new SDK:

import { getFirestore } from "firebase/firestore";
import { initializeApp } from "firebase/app";
import { getAuth} from "firebase/auth";

const firebaseConfig = {
  apiKey: "x",
  authDomain: "x",
  projectId: "x",
  storageBucket: "x",
  messagingSenderId: "x",
  appId: "x",
};


const app = initializeApp(firebaseConfig);
const db = getFirestore();
const auth = getAuth();
export { db, auth };

Here you can find more about the migration to the SDK 9 version.

Here is an example how to use the new SDK 9 with collections:

import { collection, onSnapshot } from "firebase/firestore";

const unsubscribe = onSnapshot(collection(db, "cities"), () => {
  // Respond to data
  // ...
});

// Later ...

// Stop listening to changes
unsubscribe();
about 4 years ago · Juan Pablo Isaza Report
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!