-
Notifications
You must be signed in to change notification settings - Fork 883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firebase v9 FirebaseFirestore Error #7135
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
this issue is similar to tylim88/FirelordJS#91 (comment) so this is what happen:
my deduction is this only happen at development mode of tools like this issue exist since firebase v9.17.1 the solution is to NOT transpile |
@tylim88 Can you confirm that this bug does not exist in 9.17.0 and 9.16.0? If this bug was indeed introduced in 9.17.1 then it should be easy to figure out since 9.17.1 was just an emergency bugfix release with a tiny change compared to 9.17.0. |
I removed 9.17 and installed 9.16.0 in both the UI and the module. While the I also checked all the webpack and tsconfig settings and all are set to ES2022 and I checked the compiled output has |
@d7p Thanks for checking 9.16.0. Could you update the code snippets in the opening post to include the relevant |
@dconeybe updated. if there is more context i can add let me know |
@tylim88 do you have any other ideas what could be wrong with this? |
unfortunately I am not free to help you now, but if you really need a quick solution, then I shamelessly recommend you to try my library FirelordJS, it is tested up to firebase v9.18 plus create-react-app or vite-react |
@d7p Nothing in the code that you posted looks problematic to me. Would you be able to create a minimal reproduction app in a github repository that I could clone to reproduce this for myself? |
Sorry this took a while I found other issues with that i was trying to do while creating this. FYI: Anyone try to do this just with functions you need to use a bundler or publish the package to npm as firebase doesn't upload the local modules folder. |
@d7p The reproduction app that you created... can I use it to reproduce your issue? Or are you saying that it does not reproduce the issue? |
the app does reproduce the issue. you don't even need to run the firebase emulator. if you go to the hosting directory and run the |
@dconeybe the issue started at v9.17.0, I tested with my library firelordjs@2.2.5 and react-script 5.0.1 what is working:
what is not working
do note that firelordjs@2.2.5 + firebase@9.18.0+ produce a different error: reproducible repository https://github.com/tylim88/troubleshooting-firebase run |
Those errors are caused by 9.17.0, and that bug was fixed in 9.17.1: https://firebase.google.com/support/release-notes/js It's not a Firestore bug. If the focus is on Firestore bugs, the relevant difference should be 9.17.1 vs 9.16.0. |
I was using 9.17.2 so shouldn't have had the 9.17.0 bug |
@d7p I was reading over your opening comment and noticed that in Here is a sample node.js session that shows what I mean:
Above you mentioned
but that doesn't make sense to me, unless react is doing some sort of transformation of In any case, I'm going to take a look at your reproduction app now that you mentioned in a previous comment, #7135 (comment) |
@d7p Could you give more instructions for how to use your app https://github.com/d7p/Firebase-issue to reproduce this issue? I did the following:
but it fails with this output:
Please advise. |
Ok I was able to reproduce the problem by using First, the file import {getFirestore, connectFirestoreEmulator} from "firebase/firestore"; At runtime, this ends up calling Similarly, import {collection, Firestore, getDocs, query, where} from "firebase/firestore"; However, at runtime, the It is not supported to intermix objects from the ES module and CommonJS module bundles. This explains, at least in part, why the But even if the I'm not personally familiar enough with bundling and react so I cannot help solve this problem. Perhaps someone else can comment? I'm going to close this issue, though, since there is no further follow-up required from the maintainers of this repository. Feel free to ask more questions or continue discussing with other but I won't be able to devote time to the fix unless this ends up being a problem with the code in this git repository. |
OS: MacOS M2
Firebase: 9.17.2
I have been using firebase functions for a while and now want to build an admin UI to speed up some admin tasks. The Firebase Functions and the new UI are written in Typescript and using:
This is a simplified version of how I'm setting up the UI:
In my react component I can all the db and get the expected results.
But when i move the same logic to a separate module like below
I get a runtime error:
When I check the type in Main.tsx it returns firestore but when i check the type in the UserService.ts module function it is an object. As im not using the lite version I can't see how I am even hitting this error.
Thank you for any help
The text was updated successfully, but these errors were encountered: