Skip to content
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

CSS / Script being injected into body in some circumstances #6700

Closed
1 task
darusk opened this issue Mar 29, 2023 · 1 comment · Fixed by #6779
Closed
1 task

CSS / Script being injected into body in some circumstances #6700

darusk opened this issue Mar 29, 2023 · 1 comment · Fixed by #6779
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@darusk
Copy link

darusk commented Mar 29, 2023

What version of astro are you using?

2.1.7

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

pnpm

What operating system are you using?

Windows

What browser are you using?

Chrome, Firefox

Describe the Bug

In a certain circumstance when using a component in an MDX file, the css and script links are being injected into the body of the final page at the point where the component is, instead of the head.

All pages in the example are basically the same, pulling in a simple component which takes an optional title. If the title is passed in an MDX file, the css & scripts get injected where the component starts. If the title is not given or the file is an .astro file, it gets injected into the head where it should be.

After going through all the releases from a time when it worked as expected up to recent, it came down to an update in version 2.1.6 (possibly 7daef9a29?)

Unfortunately my JS skills are extremely limited so cannot dig further!

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-hu9zun?file=src/pages/index.mdx

Participation

  • I am willing to submit a pull request for this issue.
@darusk
Copy link
Author

darusk commented Mar 29, 2023

To confirm I just tried this on the release from yesterday and it is still the same.

@matthewp matthewp added the - P4: important Violate documented behavior or significantly impacts performance (priority) label Mar 29, 2023
@matthewp matthewp self-assigned this Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants