-
Notifications
You must be signed in to change notification settings - Fork 895
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
Firestore is not a function #464
Comments
Hey there @mlapeyre3. I would be suspicious of your build process at this point. I loaded up your example on stackblitz and it works fine (i.e. the code throws no errors and the db exists properly). I'd try cleaning your yarn/npm cache and rebuilding. Additionally, ensure that you don't have multiple instances of |
Hi @jshcrowthe, Hum this is weird :( I created a new project from scratch https://github.com/mlapeyre3/firestore-issue-464 to highlight my issue.
After this initialization, I ran
You may see I created the file .\src\renderer\storage\firebase.js
which is called in .\src\renderer\components\LandingPage.vue Well .. I still get the error |
After some research, I found https://scotch.io/tutorials/getting-started-with-firebase-cloud-firestore-build-a-vue-contact-app which use an other template of vue-cli ( Thus I have asked the question at SimulatedGREG/electron-vue#513 |
For testing purpose, I implement the SDK directly in the index.ejs file of my project.
while
If this helps you ... for the moment I will continue with my ugly <script> tag in my index file 🤣 |
I think I've got it... from a post related to importing codemirror with electron-webpack. electron-userland/electron-webpack#81 This worked for me.
|
Thanks for chiming in @bdiz. Closing this issue, but if somebody knows of something the Firebase SDK should be doing to make this work better, let us know. |
WanderG's tip worked for me: |
I fixed it by importing multiple libraries: firebase and firebase/firestore. That's because the firebase core library does not include the firestore library innately. So the full code to fix it is:
|
The problem with this is it imports the entire SDK which, as seen in docs and from a warning in the browser console, is advised against. |
I've got the same error in my Jest tests (app itself worked fine). But in my case it was related to firebase storage (not firestore). Solution was similar to the highlighted above:
UPDATE:
Now both tests and app work fine. |
|
@Oyelamin could you open a new issue with this information and also include the SDK version you're using? |
was facing the same try to delete node_modules and package-lock.json after that it should work tried with latest 6.3.3 |
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
I have a VueJs application and I would like to interact with my firestore database. I have already used a firebase database with a VueJs application, so I have followed the same process to implement a firestore binding (reading https://firebase.google.com/docs/firestore/quickstart).
However, want the app starts I got the following error
Uncaught TypeError: firebaseApp.firestore is not a function (firebase.js @15)
Steps to reproduce:
Relevant Code:
Here is my firebase.js file
I have seen other issues like mine at #182 or on StackOverflow (with previous versions of the firebase package). However, I am on the 4.9.0 version and it still happens.
Did I do something incorrectly?
Thanks !
The text was updated successfully, but these errors were encountered: