Mouse events not firing outside preview mode

I’ve been troubleshooting why my site hasn’t been acting as expected when I invite users to test it out and I’ve finally realized that the only code that is firing is the code that’s linked to dataset and pages “onReady” function. The properties and events panel and using Velo code to trigger events works in preview mode, but then I switch to my personal account and nothing happens. I created a simple example below to test it and confirmed the issue.

Here’s my editor site: Wix Website Editor | Game Night Evolved


You can see the labels for the button and the text and the fact that the event handler is used. This code works in preview mode and not when I visit the site raw.

Help please?

Update: I took this snapshot from the console during a test with the live site.

Hello @jared-m-mcdonald1 ,

Please try to use the dynamic event handler instead of the current static event handler.

$w('#button3').onClick(() => {
    // Do something here
})

I’ve tried this as well and it unfortunately also doesn’t work outside of preview mode. The onready functions seem to work, but no clicks work.

Did you make sure to remove the static event handler from the code file as well as the properties panel?

Yes I saw that guidance in the forums. I’ve tried putting the dynamic code in the page’s (onReady) and outside of it. In no case have I gotten a clock to register outside of preview mode. But in preview mode everything is working as expected.

Hmm … Contact Wix Customer Care or hire a developer to debug your code, I don’t think the bug will be spotted here.

When you get a response or a solution, please consider sharing it here with the community.

I’ll do that. But I’ll also add that I have tried going to an entirely new page with no code and only coding the button and experiences the same issue. The screenshot I put up there has no other code on it. That’s what leads me to believe it’s a wix issue.

I also suspect it’s a Wix bug, that’s why I recommended reaching out to customer care.

Ahmad, do you have a recommendation on the path forward? I’ve contacted Wix Customer Care like 4 times on this issue. They explain that they cannot directly help with velo and need to hand me off to their “exclusively offline” Velo team that communicates through email only. As you can see that was 4 weeks ago and I have contacted them for check-ins, had the customer service rep mark the ticket as “urgent” and have still yet to even get confirmation from this mysterious “offline velo team” that they’re even looking at my case. Meanwhile I’ve paid Wix for this service and all the while I can’t let my site get tested like it needs to be to meet my schedule. I’m just stunned that a service as popular as wix is experiencing such a basic issue as not being able to get a site to respond to code linked to a button click outside of preview mode and can’t even execute a customer service process to acknowledge the problem is being looked at.

Forgive my frustrated rant there but I’m in serious need of some help or I’m just pulling the plug on Wix. Even though I’ve sunk so many hours into the functionality of my site with Wix, I just don’t know if I can handle this lack of customer attention. What if I need similar attention when my site is actually fully functional and I’m losing customers over it for a whole month+ with no contact? It’s unthinkable and unworkable…

I got the very same problem! Did anyone find a solution who had this problem as well?

It was working until 3 days ago with the static event handler. Then it stopped working all of a sudden on my published website. Now I tried with dynamic event handler from within the page’s onReady function and outside of it. In all 3 variants, the code is executed correctly in the preview mode, but not on the published site. Code in the onReady function is working also on the published website.

In case someone is stumbling over the same issue:
I could fix it with the help of a very friendly developer in the WIX Discord channel. The issue was, that my buttons were linking to other pages. These links have been setup in WIX Editor in the button settings. Looks like the page forwarding is happening before the onClick code is executed. I now removed the links in the editor, and added the linking inside the onClick methods (wixLocation.to(‘…’)). That is working.
Still unclear why it was working before and stopped working all of a sudden, but anyways, the issue is resolved.