Skip to content
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

WEBPACK_IMPORTED_MODULE_3_firebase_database___default(...) is not a function #5

Open
bangive opened this issue Aug 6, 2017 · 3 comments

Comments

@bangive
Copy link

bangive commented Aug 6, 2017

When i try to run the app not working, the console shown error:


Uncaught TypeError: __WEBPACK_IMPORTED_MODULE_3_firebase_database___default(...) is not a function
    at new Home (index.js?8efe:22)
    at createComponent (preact.js?10a9:220)
    at buildComponentFromVNode (preact.js?10a9:333)
    at idiff (preact.js?10a9:136)
    at innerDiffNode (preact.js?10a9:178)
    at idiff (preact.js?10a9:154)
    at diff (preact.js?10a9:111)
    at renderComponent (preact.js?10a9:292)
    at setComponentProps (preact.js?10a9:252)
    at buildComponentFromVNode (preact.js?10a9:338)

The error indicate this line this.firebaseDB = database(); in Home component

@gordongordon
Copy link

It works for me now!
Change all the follow statements in classes of Home, Input, Message
import database from "firebase/database"; -> import fb from "firebase";
Any Call of
database() -> fb.database()
e.g. in message class :

this.firebaseRef = database().ref(`chats/${nextProps.chatURL}/messages`); -> 
this.firebaseRef = fb.database().ref(`chats/${nextProps.chatURL}/messages`);

@gokulkrishh
Copy link
Owner

gokulkrishh commented Aug 29, 2017

Aww got it. Thanks @gordongordon @bangive. Sorry i got busy with work. Couldn't able to find the issue by myself.

@rec0d
Copy link

rec0d commented Oct 10, 2017

I dont understand where to add this fix, can you add the fix to the source please :)

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

4 participants