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

Content collection MDX styles missing from prod builds for non-page components #6121

Closed
1 task done
bholmesdev opened this issue Feb 3, 2023 · 1 comment · Fixed by #6152
Closed
1 task done
Assignees
Labels
- P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority)

Comments

@bholmesdev
Copy link
Contributor

What version of astro are you using?

2.0.6

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

None

What package manager are you using?

npm, pnpm

What operating system are you using?

Mac

Describe the Bug

When using content collections, MDX styles are missing in production builds when rendering from a non-page .astro component.

  1. Create an MDX content collection entry
  2. Import styles from that entry
  3. Try to render that entry from a component that is not the src/pages component (any level of nesting will work).
  4. Notice styles are present in dev, but not production build previews.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-jjdbqw?file=src/components/UsingMdx.astro,src/content/blog/using-mdx.mdx,src/pages/index.astro

Participation

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

Note the above example includes a hoisted script test as well. Hoisted scripts are correctly included, but I left this in for testing after the hoisted script PR goes in!

@matthewp matthewp self-assigned this Feb 3, 2023
@matthewp matthewp added the - P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) label Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants