Data Hooks not executing

I use data hooks extensively in my site; as of sometime before 11:40 CDT today, data hooks on the live site have become unreliable – some work some don’t. Preview mode works fine. Code has not changed in weeks. Is there something going on that we should know about? Turbo related?

As of 7:56 AM CDT – here is the console log from running my site in Safari; notice all the 403 errors for Wix items. I cleared cache just before running this series:

[Info] Successfuly preconnected to https://static.wixstatic.com/ (x2)
[Info] Successfuly preconnected to https://static.parastorage.com/
[Info] Successfuly preconnected to https://fonts.gstatic.com/
[Info] Successfuly preconnected to https://siteassets.parastorage.com/pages
[Info] Successfuly preconnected to https://wixlabs-wix-faq-11.appspot.com/index
[Info] Successfuly preconnected to https://social-blog.wix.com/
[Info] Successfuly preconnected to https://progallery.wix.com/
[Info] Loading the code for the site. To debug this code, open masterPage.js in Developer Tools. (wixcode-worker.js, line 17)
[Info] Loading the code for the Home page. To debug this code, open c1dmp.js in Developer Tools. (wixcode-worker.js, line 17)
[Warning] Wix code SDK Warning: The link parameter of “backButton” that is passed to the link method cannot be set to null or undefined. (wixcode-worker.js, line 17)
[Log] Home page was delayed by 5ms due to code (wixcode-worker.js, line 17)
[Error] Failed to load resource: the server responded with a status of 403 () (dataFixer.min.js.map, line 0)
[ Error] Failed to load resource: the server responded with a status of 403 () (wixcode-components.bundle.min.js.map, line 0)
[Info] Loading the code for the Login Lightbox popup. To debug this code, open wfdnx.js in Developer Tools. (wixcode-worker.js, line 17)
[Error] Failed to load resource: the server responded with a status of 403 () (wixcode-components.bundle.min.js.map, line 0)
[Log] login success (wixcode-worker.js, line 17)
[Log] first time success (wixcode-worker.js, line 17)
[Log] session success (wixcode-worker.js, line 17)
[Info] Loading the code for the site. To debug this code, open masterPage.js in Developer Tools. (wixcode-worker.js, line 17)
[Info] Loading the code for the Members Only page. To debug this code, open bu8rl.js in Developer Tools. (wixcode-worker.js, line 17)
[Log] test value; 30633 (wixcode-worker.js, line 17)
[Log] still ok (wixcode-worker.js, line 17)
[Log] Admin (wixcode-worker.js, line 17)
[Log] Members Only page was delayed by 488ms due to code (wixcode-worker.js, line 17)
[Error] Failed to load resource: the server responded with a status of 403 () (wixcode-components.bundle.min.js.map, line 0)
[Info] Loading the code for the site. To debug this code, open masterPage.js in Developer Tools. (wixcode-worker.js, line 17)
[Info] Loading the code for the My Account page. To debug this code, open y1w4x.js in Developer Tools. (wixcode-worker.js, line 17)
[Log] test value; 13354 (wixcode-worker.js, line 17)
[Log] still ok (wixcode-worker.js, line 17)
[Warning] Wix code SDK Warning: The text parameter of “ownerfullname” that is passed to the text method cannot be set to null or undefined. (wixcode-worker.js, line 17)
[Warning] Wix code SDK Warning: The text parameter of “primaryaddress” that is passed to the text method cannot be set to null or undefined. (wixcode-worker.js, line 17)
[Error] Failed to load resource: the server responded with a status of 403 () (wixcode-components.bundle.min.js.map, line 0)
[Log] My Account page was delayed by 2527ms due to code (wixcode-worker.js, line 17)
[Info] Loading the code for the site. To debug this code, open masterPage.js in Developer Tools. (wixcode-worker.js, line 17)
[Info] Loading the code for the Update Member Profile page. To debug this code, open lm1cj.js in Developer Tools. (wixcode-worker.js, line 17)
[Log] test value; 10400 (wixcode-worker.js, line 17)
[Log] still ok (wixcode-worker.js, line 17)
[Log] Update Member Profile page was delayed by 494ms due to code (wixcode-worker.js, line 17)
[Error] Failed to load resource: the server responded with a status of 403 () (wixcode-components.bundle.min.js.map, line 0)
[Info] Loading the code for the site. To debug this code, open masterPage.js in Developer Tools. (wixcode-worker.js, line 17)
[Info] Loading the code for the My Account page. To debug this code, open y1w4x.js in Developer Tools. (wixcode-worker.js, line 17)
[Log] test value; 16524 (wixcode-worker.js, line 17)
[Log] still ok (wixcode-worker.js, line 17)
[Warning] Wix code SDK Warning: The text parameter of “ownerfullname” that is passed to the text method cannot be set to null or undefined. (wixcode-worker.js, line 17)
[Warning] Wix code SDK Warning: The text parameter of “primaryaddress” that is passed to the text method cannot be set to null or undefined. (wixcode-worker.js, line 17)
[Error] Failed to load resource: the server responded with a status of 403 () (wixcode-components.bundle.min.js.map, line 0)
[Log] My Account page was delayed by 938ms due to code (wixcode-worker.js, line 17)

#datahooks_not_executing #live_site_not_working #wixturbo

1 Like

I’ve been having this issue as well, specifically i had code dynamically change the border color of a $w.box based on changes made to my database. however it suddenly stopped working today, it was working fine for the past few weeks up till today.

i noticed my site works fine on the browsers: brave and internet explorer

@chaim-kram I know you are focused on Turbo issues, but this is a show stopper right now. Based on other posts I have seen in the forum, I am not alone in having data hooks cease to function on Live. Anything you can share about this?

1 Like

How come no one is giving us answers about this issue? We have live websites here! I have the same problem here

1 Like

I have the same issue. Within the last two weeks data hooks have stopped firing on insert. It has compromised my live site. When can we rely on data hooks again?

1 Like

As there has been no information or update on this issue, I am in process of moving my data hook code from data.js to my own .jsw modules over which I have direct control. It is not acceptable to have a documented feature unavailable or unreliable for an extended period in a Live site.

#nosupport #datahooks #unreliable #unavailable #livesite

1 Like

Open a ticket with Wix Support

Please share your code here

@shantanukumar847 I have done so. Their standard response is:

Please note that data hooks is an advanced Wix Code feature that requires manual coding.
While we support Wix Code features and components here in the Support center, we are unable to provide support for custom coding.
For your needs please visit our Wix Code Forum . The Forum is a community where developers and other Wix users engage in common questions and issues.

So, no help at all.

2 Likes

Which code? data.js or what I am doing now?

@davebogan98 data.js and the function on the page or backend which calls the hook

@davebogan98 I have had the same response from Wix. They said my only course of action is to hire a ‘Wix expert’ to look at the problem, which I have done. The third party says they think they have a solution which they will let me have in the next 24 hours.

@shantanukumar847 if you’re looking for code look at my post on the same issue

@shantanukumar847 Up until a few days ago, the code in data.js had been executing normally for many months. No changes have been made in weeks. Data hooks (as you know) are called automatically by Wix when certain database actions are performed; therefore, my page code does not call the hook directly – it calls a wixData action like insert or update, which then calls the hook. So there is Wix generated code in-between by page code and data.js. The problem is there, which is why we have been trying to get Wix to respond.

I haven’t changed the code either in weeks. I noticed my data hooks stop working properly a couple of days ago as if it were a general bug

1 Like

Hi,

Since Peter is the only one who provided the non-functioning code I have tried it out and I’m writing my solution on his post. Check it out.

https://www.wix.com/code/home/forum/community-discussion/data-hook-not-working-on-live-site-but-working-ok-in-preview

I am eagerly awaiting your solution.

For completeness I will add the answer from the other comment here also.
Check the API result requirement. If the API requires you to return a Promise then you have two options:

  1. Make the hook function async. Here is why:
    The async function declaration defines an asynchronous function , which returns an AsyncFunction object. An asynchronous function is a function which operates asynchronously via the event loop, using an implicit Promise to return its result. But the syntax and structure of your code using async functions is much more like using standard synchronous functions.

  2. Use the Promise.resolve() function to return the item you want to return

return Promise.resolve(item);

So if you have a hook API with the following Syntax:


make sure you return a Promise as it asks you to :wink:

To generate an error and trigger the onFailure() as described you can either:

  1. Throw an error:
throw Error('The hook failed!');

or
2. return a Promise.reject:

return Promise.reject(new Error('The hook failed'));

Cheers