firebase / firebase-js-sdk

Firebase Javascript SDK
https://firebase.google.com/docs/web/setup
Other
4.78k stars 876 forks source link

`@firebase/firestore: Firestore (10.1.0): INTERNAL UNHANDLED ERROR: TypeError: e.toDescriptor is not a function` #7532

Open afifurrohman-id opened 11 months ago

afifurrohman-id commented 11 months ago

Operating System

Windows

Browser Version

Deno fresh

Firebase SDK Version

10.1.0

Firebase SDK Product:

Firestore

Describe your project's tooling

Deno fresh 1.3.0 SDK import from esm.sh

Describe the problem

@firebase/firestore: Firestore (10.1.0): INTERNAL UNHANDLED ERROR: TypeError: e.toDescriptor is not a function

I just want to set simple data

 const db = getFirestore(firebaseApp)
  const docRef = doc(db, 'app', 'test')
  await setDoc(docRef, {
    name: 'test',
  })

or get data

const docSnap = await getDoc(docRef)
console.info(docSnap.data())

Steps and code to reproduce issue

 const db = getFirestore(firebaseApp)
  const docRef = doc(db, 'app', 'test')
  await setDoc(docRef, {
    name: 'test',
  })
MarkDuckworth commented 11 months ago

There may be an issue with your import. Does the same error occur if you import using npm specifiers or package.json rather than importing from esm.sh?

Also are you able to provide us with any additional error context or logs from the Firebase SDK?

MarkDuckworth commented 11 months ago

Can you also give us a code snippet that shows how you are currently importing Firebase packages via esm.sh?

afifurrohman-id commented 11 months ago

There may be an issue with your import. Does the same error occur if you import using npm specifiers or package.json rather than importing from esm.sh?

Also are you able to provide us with any additional error context or logs from the Firebase SDK?

Idk, didn't try it

afifurrohman-id commented 11 months ago

Can you also give us a code snippet that shows how you are currently importing Firebase packages via esm.sh?

import { getFirestore } from 'https://esm.sh/firebase@10.1.0/firestore'
afifurrohman-id commented 11 months ago

This issues also happen in Firebase realtime database sdk

MarkDuckworth commented 11 months ago

Thanks for the code snippet. We will add this to our backlog. In to near term, consider trying to import using npm specifiers or package.json rather than importing from esm.sh