Description
Astro Info
Astro v5.1.1
Node v23.5.0
System macOS (arm64)
Package Manager npm
Output static
Adapter @astrojs/node
Integrations astro-meta-tags
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
Participation
- I am willing to submit a pull request for this issue.
Activity