Closed jamesli2021 closed 21 hours ago
Hello @jamesli2021. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs repro
will be closed if they have no activity within 3 days.
I couldn't see clearly with bad editor on this site that's deteriment to my vision, but you get the idea from my code. https://stackblitz.com/edit/github-nuaezo-kcb88z
This does work if you enable directRenderScript
: https://docs.astro.build/en/reference/configuration-reference/#experimentaldirectrenderscript
As this option will likely be the default in 5.0 I think we'll not try to fix this with that option turned off.
directRenderScript
is not the default in Astro 5 (try beta with astro@alpha
)
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
<Nav/>
astro component is inOtherPage.astro
, the client-side JavaScriptdocument.getElementById
could not detect the HTML in ID, which assume the script has executed before the component is render?Removed
server:defer
will work as usual, in SSR mode.What's the expected result?
How should this situation be dealt with?
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-nuaezo-kcb88z
Participation