anonymous-web icon indicating copy to clipboard operation
anonymous-web copied to clipboard

WEBPACK_IMPORTED_MODULE_3_firebase_database___default(...) is not a function

Open bangive opened this issue 7 years ago • 3 comments

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

bangive avatar Aug 06 '17 18:08 bangive

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`);

gordongordon avatar Aug 29 '17 17:08 gordongordon

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

gokulkrishh avatar Aug 29 '17 18:08 gokulkrishh

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

rec0d avatar Oct 10 '17 08:10 rec0d