astro:page-load
broken and inconsistent, breaks scripts
#12858
Labels
needs triage
Issue needs to be triaged
astro:page-load
broken and inconsistent, breaks scripts
#12858
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Initially, I could only get this to reproduce on Safari as it happens almost every time (especially iOS), but inconsistently, Chrome also has the bug. Sometimes when navigating to a page for the first time,
astro:page-load
is not triggered. After refreshing the page or navigating away and back, it triggers twice.Utilizing the browser’s navigation controls instead of links seems to cause this more consistently. Whenever on a page with an
astro:page-load
script and you utilize browser controls to go back to a previous page, it will fire off the same script again, causing unintended side effects, especially if using event listeners.What's the expected result?
astro:page-load
only triggers once and is consistent. Utilizing browser navigation controls should not interfere as well.Link to Minimal Reproducible Example
example
Participation
The text was updated successfully, but these errors were encountered: