After installing the firebase package in WIX, still have problem in basic functions.
Installed firebase 5.8.* in WIX node module. firebase.firestore()… gave error “firebase.firestore is not a function”
import * as firebase from “firebase/app”;
import ‘firebase/firestore’;
var firebaseConfig = { …
};
firebase.initializeApp(firebaseConfig);
firebase.firestore().collection("dfa").doc('tedafdst').set(data);
The error is “firebase.firestore is not a function”.
Any comment and suggestion is appreciated
I don’t understand the following line:
import * as firebase from "firebase/app"; import 'firebase/firestore';
Seems to me that the second import in the line is an error and may be causing the problem.
As Yisrael states above, imports need to be on seperate lines.
Also, have you read Firebase own support pages for installing their own Nodes.
https://www.npmjs.com/package/firebase
There is also an old forum question on this here which was posted before the Nodes became available in Wix Node Manager, however it might still be worth a read.
Also, from your posted info, as you mention Firestore, then you might be better seeing if you can run it from Firebases other Node of Firestore, as it also states on Firebase own page which I had already linked above.
Taking the pic from Yisrael original post in the old forum post here.
Finally, this may be a bit old now, however have a read of this old post from Stack too.
https://stackoverflow.com/questions/37378050/how-to-get-and-set-data-to-firebase-with-node-js
That is an editing problem. In my code, two imports are in two separate lines.
Have read all posts online, not talking the same problem or not working well.
Tried to install Firestore package, gave different error message when calling firestore(). directly.
I got WIX connecting to Firebase working with firebase-admin package.
Now I am highly suspicious that the Firebase package in the WIX’s npm depository is a bug version. Just requested because the websites says the fixes in 5.8.1 and 5.8.2 are related to fire path or dependency. That is consistent with the error message that the firestore function is not found, basically.
An update, after WiX team permits newer version of FireBase, the same problem exists. My current guess is that sync up with external base is only working with published site, not the preview version. Gave up on that route long time ago, so a pure guess with tested result.
Hey,
We are aware of the issue and I am pleased to inform you that our technical team has implemented a fix and we do not expect any further difficulties regarding this matter.
Can you please doublecheck if it works properly on your side and let us know?
Thanks in advance, we await for your reply.
Unfortunately am still getting the same issue. Did anyone figure out a way around this?
Understand that this forum is not a support site, and is not monitored for bugs or system issues. Please report bugs to Wix Customer Care to ensure timely handling of your problem. They track and monitor all incoming issues and will escalate bugs to product teams.