-
Notifications
You must be signed in to change notification settings - Fork 0
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 not a function #3
Comments
Check to see if you’re importing Firebase at the top of your component next to import React from ‘react’. |
const db = firebase.firestore(); |
The Firebase instance is exported from firebase.js as |
In your ./src/firebase/db.js try adding the following import at the top. Got this idea from stack overflow and comparing your code to mine.
|
well changing the import statement does change the error message: However, in firebase.js we have I also tried moving all db.js logic into firebase.js and achieved the same results. |
Try this below (: |
Seem to point db.js towards the actual firebase library rather than my code to initialize firebase.
But, changing the import statement to: `import * as firebase from './firebase' we get this:
I'm going to have to reread firestore docs before attempting to fix this again. |
It didn't work for me either, just the red screen of death
…On Sun, May 5, 2019, 1:21 PM Walker Chesley ***@***.***> wrote:
Seem to point db.js towards the actual firebase library rather than my
code to initialize firebase.
Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app/no-app).
But, changing the import statement to: `import * as firebase from
'./firebase' we get this: ``` Failed to compile
./src/firebase/db.js
Attempted import error: 'firestore' is not exported from './firebase'
(imported as 'firebase').
I'm going to have to reread firestore docs before attempting to fix this again.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKIHJXBF2BLW6YOK6ITUVDDPT4QTRANCNFSM4HAX7SEA>
.
|
Error code:
TypeError: _firebase__WEBPACK_IMPORTED_MODULE_0__.default.firestore is not a function
Error thrown in ./src/firebase/db.js
Line 3:
const db = Firebase.firestore();
The text was updated successfully, but these errors were encountered: