Site all of a sudden throwing errors with dataset onReady

I’ve been using my site for many weeks with no major issues. But now it is springing errors all over my site whenever there is a line in my code that uses an onReady with a dataset - an example is below:

$w.onReady(function () {
    $w("#Scraper").onReady(() => {
        product_name = $w("#text113").text;
    });
})

It is throwing the error message below both in preview and live. The dataset is labelled correctly. It all seems to have happened literally overnight.

So what changes have I made that could have triggered this? I installed the app “Comments & Reviewers” by POWR and perhaps that’s the cause of this. To test that I reverted the website version back to one a few days ago before I installed the app but still no luck.

This is crashing almost every page on my site, for now I’ve collapsed the elements/strips where it is causing errors on the site.

I don’t recognise “t.config” from below - is that a potential issue caused by the installing of the app?

TypeError: undefined is not an object (evaluating ‘t.config’)
TypeError: $w(“#Scraper”).onReady is not a function. (In ‘$w(“#Scraper”).onReady(function () {
product_name = $w(“#text113”).text;
})’, ‘$w(“#Scraper”).onReady’ is undefined)
TypeError: undefined is not a function (near ‘…$w(“#Scraper”).onReady…’)

To provide some further context on this issue, given the function below:

1. $w.onReady(function(){
2.     $w("#Scraper").onReady(()=>{
3.
4.          product_name =$w("#text113").text;
5.     });
6. })
  • The Velo selector $w(#Scraper) returns an object type [object Object]

  • The linked dataset is on the page, and tagged with the correct id Scraper (as evidenced by the type being returned

  • the return value from $w(#Scraper) does not have a method onReady, and when printed to the console prints undefined

  • when printing $w(“#text113”).text outside of the onReady() function, the expected value is printed (i.e. it’s not an issue with the $w function

  • The error message printed to the console is TypeError: $w(...).onReady is not a function, and occurs on line 2 of the example above

  • When debugging is added within the onReady function (on line 3 of the function above), nothing is printed validating that the function does not execute

  • There is an additional error message printed to the console TypeError: Cannot read properties of undefined (reading 'config') with no Line number. There is no mention of the word ‘config’ in any javascript files across the website (including the global packages)

  • There has been no change in external libraries used

  • This additional error message about ‘config’ is printed to the console in preview mode regardless of the code in the page or global JS files (validated by hashing out all global JS files and all code in the page JS file)

Console errors:

@yisrael-wix Would (hugely!) appreciate your brain power if you get a moment? Thank you so much

Brain Power? Me? Now that’s funny.

Some questions:

  • Do you have a dataset on the page with the id #Scraper?

  • Are you sure? That is, upper/lower case, spelling, etc.

  • Is the #Scraper dataset connected to a database collection?

  • Where is your code?

  • What is the larger context? What other code do you have on this page?

All I can say is that I have a number of sites with datasets that use the onReady() function and I have no problem. Seems as if you have a problem with your code or configuration.

Thanks @yisrael-wix

In opening I’m in a similar place to your last comment, I have the Scraper dataset linked all over the site on multiple pages and all of a sudden it’s started throwing this error on all the pages with the onReady.

  • Do you have a dataset on the page with the id #Scraper ? Yes

  • Are you sure? That is, upper/lower case, spelling, etc. Yes, spelling is correct

  • Is the #Scraper dataset connected to a database collection? Yes

  • Where is your code? The original post contains code from the page code for “Auction Results”

  • What is the larger context? What other code do you have on this page? There’s another 800 odd lines of code on the site, more than happy to provide you access to the site - what’s the easiest way to do that? My assumption giving this is happening across multiple pages is it’s not page specific code I’ve written triggering this issue but rather something applying across all pages (particularly so given the reference to ‘config’ error in the console

I’m not aware of any issues similar to yours. Either you’ve done something drastic that isn’t so obvious, or there is some sort of bug. It might be best to direct your question to Wix Customer Care . They track and monitor all incoming issues and will escalate bugs to product teams.

Cheers @yisrael-wix , I’ve submitted a request already just waiting on them to come back.

Final question: Is it plausible that the installing of the comments app would have triggered some of these issues given their was a direct timing correlation between installing it and them occurring?

If yes, is there a possible explanation that despite going back to a version of the site pre install of the app that some residual files from the install could still be causing a problem?

@yisrael-wix Interesting revelation just now which indicates a potential different issue to previously thought.

Below is a video of it in action. The original errors appearing in the console stop a few things happening on the page displaying individual sold cars, namely the “Similar Cars” section doesn’t run so the text is left with placeholders rather than replaced with calculations that run in the background.

If you navigate from the landing page → the individual car page, the similar cars section doesn’t load.

If you navigate from the individual car page → (another) individual car page, the similar cars repeater does load.

Context above shared so the video makes sense. Any thoughts? Happy to share the site with you so you can dive in deeper if helpful