8000 default.auth() is not a function · Issue #17 · michael-burrows-github/blog · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

default.auth() is not a function #17

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

Open
amc8mf opened this issue Jan 10, 2021 · 0 comments
Open

default.auth() is not a function #17

amc8mf opened this issue Jan 10, 2021 · 0 comments

Comments

@amc8mf
Copy link
amc8mf commented Jan 10, 2021

Hey there Michael,

Thanks a lot for writing this, it helped me a lot today. Wanted to bring something to your attention - I got the following error at the end: TypeError: config_js__WEBPACK_IMPORTED_MODULE_2_.default.auth is not a function

After some googling I found this article: https://stackoverflow.com/questions/48551602/firebase-initializing-without-auth-firebase-auth-is-not-a-function

With this, I had to change my config.js a bit and then got it to work:

`import firebase from "firebase";
import "firebase/auth";
var firebaseConfig = {
...
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);

export const firebaseAuth = firebase.auth;`

Then in other files like Auth, I do this:
import { firebaseAuth } from '../config' firebaseAuth().onAuthStateChanged((user) => {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0