Greetings, I’m not able to run my code while publishing it on the main page, it only runs on preview, I haven’t been able to figure out what’s going on, I wrote the following code in the “Site Code section”:
import wixData from ‘wix-data’;
$w.onReady(function () {
wixData.query(“RbeDatabase”)
.count()
.then((num) => {
var numberOfItems = new String(num);
$w(“#conteo”).text = numberOfItems.valueOf();
})
.catch((error) => {
let errorMsg = error.message;
let code = error.code;
});
});
What am I supposed to do in order to run it in the main website???