I’m facing an issue in my WeWeb project where the Page Load event does not trigger when I refresh the browser. The page itself loads correctly, but the workflow attached to the Page Load event never runs.
The App Load event, however, works as expected.
This issue is also occurring on my production site, not just in the editor.
As a temporary workaround, I’ve duplicated the same workflow:
- One workflow is triggered on App Load
- The other is triggered on Page Load
With this setup, everything works as expected, but I’m trying to understand why the Page Load event isn’t firing on browser refresh.
Has anyone experienced this issue before, or is there something I might be missing?
Hey!
How are you checking if the workflow actually triggered? The issue might be that the action inside the workflow isn’t doing what you expect, rather than a trigger failure.
Have you tried throwing a js action like alert('triggered') at the very start to see if it’s firing?
Hope this helps !
Hugo from OneClick
Thanks for the suggestion. I already tried that approach.
To explain what I’m doing:
When the page loads, I first check whether the user’s access token has expired. Based on the result, I perform different actions:
- If the access token is still valid, I continue with the normal page logic.
- If the access token has expired, I redirect the user to the public page.
The issue is that this doesn’t work consistently. When I navigate to the page normally, the Page Load event is triggered and everything works as expected. However, if I refresh the browser while already on that page, the Page Load event does not trigger, so none of this logic is executed.
Thanks for the advice. I noticed that in the On App Load workflow, I was running a loop before fetching the data, which caused the workflow to never complete. Because of that, the other event-triggered workflows didn’t execute, including the On Page Load workflow.
After stopping that loop, the other workflows started running as expected, and the On Page Load trigger executed correctly.
This is what I’ve noticed so far, though I’m not completely sure if that’s the exact reason.