Javascript code only executing when manually hit "Run" in workflow (was working before)

Hey guys,

So this one is a bit tough to explain, so I’ll make a Loom. But essentially:

I have custom Javascript code to create a streaming effect for chat application. For some reason, the Javascript code is not properly working if I click on the “run” button in the UI. But, when I click “Test” on the SAME workflow in the no-code editor, it works. I’m just using 1 boolean variable to control the display of the streaming block (streaming block will play things out…then make the bool variable false to hide the streaming block).

Here’s the Loom: vasc-ai | WeWeb - 7 July 2024 | Loom

The strangest part about this is that it was working perfectly before. Only in the past 2 weeks did it stop working.

Thanks for your help!

Hey @infinitetinker

That is weird indeed, even more if it was working before…
You can submit a ticket here so that the team can take a look :slight_smile: https://support.weweb.io/

Hey @infinitetinker ,

Did you manage to solve this? I’m running a test on my app and facing a very similar issue. It works during the test, but not on the button.

Running in to this as well :melting_face: cannot figure out the issue

It seems like this is a feature of WeWeb; you need to be in the preview for certain actions to work. It’s a terrible pattern, but WeWeb told me “it’s as intended”

1 Like

if you post a new topic with details of the issue it’s easier to find help :slight_smile:

1 Like

Yeah, I needed to figure it out right then so I couldn’t wait for a solution haha

I had to refactor my code quite a bit, but it had something to do with WeWeb not handling the importing of a package correctly. But finally got it working :smile:

do you mean the npm plugin?

I mean there isn’t an importing package specific to weweb, it’s only html and js.