Hey, I'm encountering a persistent TypeError: undefined is not an object in production, and I’ve ruled out every possible cause.
Astro version: 5.12.4 (also appeared on 5.10.1)
Output: static
Using integrations: <@&1055234544183287879>/react, <@&1055234544183287879>/tailwind, <@&1055234544183287879>/partytown, <@&1055234544183287879>/mdx, <@&1055234544183287879>/sitemap
Using ClientRouter imported from astro:transitions, but removing them doesn't fixed the issue.
✅ What I’ve tried and confirmed:
Clean dist/ via npm run build
Upload to a real web server via FTP
Verified there are no traces of ClientRouter or astro:transitions in source or layout and error persists
Used astro check → no errors
Grepped dist/ for startViewTransition, navigation.entries, etc → still present in JS
Confirmed that even in final dist/, a module script exists that references astro:before-preparation and throws the TypeError on Brave Mobile on iOS but not on desktop, nor on Safari or Firefox or Chrome, connecting iPhone to web devtools doesn't give any information other than the message TypeError: undefined is not an object
⚠️ Problem:
The error appears before any render, even before the page loads.
The stack trace always points to an injected script (likely Astro’s view transitions polyfill or prefetch script).
It breaks only on Brave Mobile, where window.navigation exists but is partially implemented (thus navigation.entries throws).
Is there any way to fix this issue I'm missing? The page on Brave on iOS seems to be trying to load something in an endless loop while you navigate, the page doesn't reload itself, but tries to load something as the loading bar at the bottom randomly appears
Thanks!