You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In astro v4 <script> tags were hoisted to the head. In v5, they are now rendered in place by default.
Is there a way to restore the previous hoisting functionality? The reason we noticed this change is because we have CSS that targets next elements (e.g. .component + footer) that no longer work because a <script> tag is inserted between the component and the footer.
Additionally, the hoisted script tags were previously compiled into a single javascript file in v4. Now, those <script> tags have the javascript directly rendered in the HTML of the page.
What's the expected result?
The ability to specify a hoisted script behavior to match v4, or confirmation that hoisted scripts are no longer supported.
Hello @dylanfisher. 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.
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
https://docs.astro.build/en/guides/upgrade-to/v5/#script-tags-are-rendered-directly-as-declared
In astro v4
<script>
tags were hoisted to the head. In v5, they are now rendered in place by default.Is there a way to restore the previous hoisting functionality? The reason we noticed this change is because we have CSS that targets next elements (e.g.
.component + footer
) that no longer work because a<script>
tag is inserted between the component and the footer.Additionally, the hoisted script tags were previously compiled into a single javascript file in v4. Now, those
<script>
tags have the javascript directly rendered in the HTML of the page.What's the expected result?
The ability to specify a hoisted script behavior to match v4, or confirmation that hoisted scripts are no longer supported.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-3h3aehry?file=src%2Fcomponents%2FWelcome.astro
Participation
The text was updated successfully, but these errors were encountered: