anonymous-web
anonymous-web copied to clipboard
WEBPACK_IMPORTED_MODULE_3_firebase_database___default(...) is not a function
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
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`);
Aww got it. Thanks @gordongordon @bangive. Sorry i got busy with work. Couldn't able to find the issue by myself.
I dont understand where to add this fix, can you add the fix to the source please :)