-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hoisted scripts missing for content collection entry with MDX #8034
Comments
This was referenced Aug 11, 2023
lilnasy
added
needs response
Issue needs response from OP
and removed
needs triage
Issue needs to be triaged
labels
Aug 15, 2023
Thanks for confirming! Closing as duplicate of 7761. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: