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

305
Views
Svelte Firebase: Unresolved function or method firestore()

I'm working with svelte on a todo list with firebase. I think I have everything installed, but I get the error in my firebase.js file: Unresolved function or method firestore() same for auth(). what is the reason for this? My Code:

import firebase from "firebase/app";
import "firebase/auth";
import "firebase/firestore";

var firebaseConfig = {
// my config here

};

firebase.initializeApp(firebaseConfig);

export const auth = firebase.auth();
export const googleProvider = new firebase.auth.GoogleAuthProvider();

export const db = firebase.firestore();

Thanks for any help.

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

0

If you use the latest and recommended firebase version (9) your firebase.js looks like this:

import { initializeApp } from 'firebase/app';
import { getAuth, GoogleAuthProvider } from "firebase/auth";
import { getFirestore } from "firebase/firestore";
import { getStorage } from "firebase/storage";
import { firebaseConfig } from "../firebase.config.js";

const app = initializeApp(firebaseConfig);

export const auth = getAuth();
export const provider = new GoogleAuthProvider(); 
export const db = getFirestore(app);
export const storage = getStorage(app);

and you have to include firebase in your package.json like:

{
  "name": "...",
  "version": "1.0.0",
  "author": "...",
  "repository": {
    "type": "git",
    "url": "https://github.com/..."
  },
  "license": "MIT",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "serve": "vite preview"
  },
  "devDependencies": {
    "@sveltejs/vite-plugin-svelte": "^1.0.0-next.30",
    "svelte": "^3.44.0",
    "vite": "^2.6.12",
    "firebase": "^9.1.3",
  }
}

This works fine for me.

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!