What version of astro are you using?
1.0.0-beta.12
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
pnpm
What operating system are you using?
Mac
Describe the Bug
Turbolinks merges script tags in head and will not run a script more than once, so Astro islands will not hydrate when viewing a page for the second time.
This is only an issue with the Turbolinks integration at the moment. An easy fix would be to add hydration scripts to body instead of head. However, I can imagine other scenarios where it would be useful to insert and remove islands and have hydration handled automatically, so I think using a MutationObserver would be a more general solution.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-kq5z3u?file=src/pages/about.astro
Participation
What version of
astroare you using?1.0.0-beta.12
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
pnpm
What operating system are you using?
Mac
Describe the Bug
Turbolinks merges
scripttags inheadand will not run a script more than once, so Astro islands will not hydrate when viewing a page for the second time.This is only an issue with the Turbolinks integration at the moment. An easy fix would be to add hydration scripts to
bodyinstead ofhead. However, I can imagine other scenarios where it would be useful to insert and remove islands and have hydration handled automatically, so I think using a MutationObserver would be a more general solution.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-kq5z3u?file=src/pages/about.astro
Participation