firebase / firebase-js-sdk

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

getDoc() is never resolved nor rejected using Remix and Firestore Lite #8195

Closed jdgamble555 closed 3 weeks ago

jdgamble555 commented 3 weeks ago

Operating System

Windows 11, Vercel Production

Browser Version

Chrome 124.0.6367.61

Firebase SDK Version

10.11.0

Firebase SDK Product:

Firestore

Describe your project's tooling

Remix does not resolve on regular getDoc path. I am using the latest version of Remix, although there is a rollup bug so I had to override the latest version in package.json.

"overrides": {
  "rollup": "4.15.0"
}

Describe the problem

Everything works find and resolves as expected when using firebase/firestore, but when switching to firebase/firestore/lite, the path does not resolve. I believe it is related to the same issue here.

Steps and code to reproduce issue

Create a new Remix project and with a path about. Fetch a document using the loader and firebase/firestore. Make sure that works. Now switch to firebase/firestore/lite and you will see it never resolves.

Debug Info

[2024-04-22T13:05:29.729Z]  @firebase/firestore: Firestore (10.11.0_lite): RestConnection Sending RPC 'BatchGetDocuments' 0x23ee4115: https://firestore.googleapis.com/v1/projects/test-projects-19046/databases/(default)/documents:batchGet {
  documents: [
    'projects/test-projects-19046/databases/(default)/documents/about/ZlNJrKd6LcATycPRmBPA'
  ]
}

Here is the test repo (need to add any Firebase credentials):

https://github.com/jdgamble555/remix-firebase-test/blob/master/app/lib/about.server.ts

https://github.com/jdgamble555/remix-firebase-test

The test deployed version (deployed working without Lite):

https://remix-firebase-test.vercel.app/

J

cherylEnkidu commented 3 weeks ago

Hi @jdgamble555

Could you please try to use lite SDK directly without Remix and check if you are running into same problem?

jdgamble555 commented 3 weeks ago

It is only a Remix problem, as it works fine in NextJS. But the Remix problem only happens with firebase/firestore/lite. Not sure if there is something in the package that would cause this?

J

cherylEnkidu commented 3 weeks ago

Hi @jdgamble555 ,

It is likely the issue is under Remix instead of Firestore Lite. The Firestore SDK team doesn't have context for Remix. Could you please consult Remix team for help?

hsubox76 commented 3 weeks ago

Following the linked issue in Remix, it looks like it is in fact a Remix issue (trying an experimental flag in Remix fixes this issue). I'll close this for now, notify us to reopen it if there turns out to be an error on our end.