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
Similar to issue #5991 as seen in this comment in the issue, when using Astro components in MDX with Content Collections, hoisted scripts are ignored. Inline scripts are still present (on a theme), both on dev server and on build.
Stackblitz seems to not be working for this repo, for which I've submitted an issue to as well...
Starting a fresh dev server reproduces this issue, but adding an is:inline directive to the concerning script then removing it, triggering hot reload, makes the issues go away, as seen in the videos below:
@lilnasy I think it is a duplicate of #7761 because I added tried adding a script to the reproducible example in that thread like here, and pretty much seems to be the same issue as mine. I'll add further comments in that issue! Thank you.
What version of
astro
are you using?2.10.5
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Mac
What browser are you using?
Chrome
Describe the Bug
Similar to issue #5991 as seen in this comment in the issue, when using Astro components in MDX with Content Collections, hoisted scripts are ignored. Inline scripts are still present (on a theme), both on dev server and on build.
Steps to reproduce
npx astro add mdx
content/blog
npm run dev
I created a repository which goes through these steps which you can clone and just install & run.
Additional Contexts
Stackblitz seems to not be working for this repo, for which I've submitted an issue to as well...
Starting a fresh dev server reproduces this issue, but adding an
is:inline
directive to the concerning script then removing it, triggering hot reload, makes the issues go away, as seen in the videos below:first part (non inline script not working)
second part (declared inline, then removed, then working again)
What's the expected result?
Non-inline
<script>
tags in an astro component is supposed to be hoisted and inserted into<head>
of the resulting page.Link to Minimal Reproducible Example
https://stackblitz.com/github/noidwasavailable/astropaper-mdx?file=README.md
Participation
The text was updated successfully, but these errors were encountered: