Javascript function not working in preview mode but working in browser

Hi, I’ve got a really weird problem. I wrote a Javascript function that updates an app connect variable, which then automatically refreshes form inputs and components that are linked to the variable value. The Javascript function is run from a flow, linked to a button with a dmx action on click.

It works perfectly as intended in Chrome, however when I test it in Wappler in preview mode it does nothing. It’ll be annoying to test the functionality by deploying it to Docker and Chrome every time I make a change, so is there a way to fix this?

It’s difficult to say why it isn’t working, do you get an error with design view?

You can see errors when clicking on these icons: image

Thanks, nope see pic attached!
no_error_screenshot_wappler