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)
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 ;-)
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
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 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
Please share your code here
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
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?
How come no one is giving us answers about this issue? We have live websites here! I have the same problem here
@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?
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