Getting error DatasetError: Operation (getTotalCount) and Operation (onReady) not allowed on an unconfigured dataset

About 2 days ago, the same old code start getting the following error and page is not loading to due to 500 error. However, not sure what are the causes.

DatasetError: Operation (getTotalCount) not allowed on an unconfigured dataset
DatasetError: Operation (onReady) not allowed on an unconfigured dataset

Anyone has idea for the solution? thank you for the help!

$w.onReady(function () {

 if (wixWindow.rendering.renderCycle === 1) {

       $w("#appDataset").onReady(() => {

            // Show total candidate count
            let count = $w("#appDataset").getTotalCount(); // ex. 23
            $w("#textTotalCandidates").text = count.toString();

            refreshItemComponents();
        });
});

Is the dataset connected to a database?

yes, it has been working for months, but 2 days ago it somehow stop working without any code modification. then I’m debugging and found this error.

@jerry-wu Your dataset is not fully loaded when your code is executing. You need to add an onReady for your dataset in the code just after the page onReady

$w(“#dataset1”).onReady( () => {

//do some stuff with dataset here

})

@mikemoynihan99 I tried that, but then it turns into the error DatasetError: Operation (onReady) not allowed on an unconfigured dataset.

@jerry-wu have you tried removing the dataset and then re-adding the dataset to your page?

@mikemoynihan99 Thanks for the suggestion, yes, that works! The dataset error went away. However, the page 500 error still there. I’m guessing something to do with Wix server, perhaps they changed some logic and break all the existing database links and also leads to 500 error. Nowever, 500 error is a different bug from the dataset…

@jerry-wu
500 error is a very generic error message and gives little detail as to what is causing it. Can be caused by a server side error. Contact
Support@wix.com

@jerry-wu I had this same error and realized I was adding a filter to the dataset that ruled out all the database items. Might not be your problem, but that was the issue for me.

Severe malfunction The only solution. It’s simple to delete and re-add.
This also happens in the filter.
A lot of filters were broken. Simply go through the filters and fix them.