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

🐛 BUG: <Fragment> breaks MDX files #4130

Closed
1 task
delucis opened this issue Aug 3, 2022 · 0 comments · Fixed by #4136
Closed
1 task

🐛 BUG: <Fragment> breaks MDX files #4130

delucis opened this issue Aug 3, 2022 · 0 comments · Fixed by #4136
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) pkg: mdx Issues pertaining to `@astrojs/mdx` integration

Comments

@delucis
Copy link
Member

delucis commented Aug 3, 2022

What version of astro are you using?

v1.0.0-rc.4

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

n/a

What package manager are you using?

npm

What operating system are you using?

macOS / Stackblitz

Describe the Bug

Using <Fragment> in an MDX file causes an error:

Unable to render MDXContent!

There is 1 renderer configured in your `astro.config.mjs` file,
but it was not able to server-side render MDXContent.

Did you mean to enable `@astrojs/react`, `@astrojs/preact`, `@astrojs/vue` or `@astrojs/svelte`?

My use case is an Astro component with named slots where you want to target a slot without adding a wrapper element:

<ComponentWithSlots>
  <Fragment slot="title">Text node</Fragment>
</ComponentWithSlots>

But the bug is not limited to named slots — any use of <Fragment> will trigger this error.

Notably the shorthand <></> syntax is supported, but that won’t allow specifying a named slot.

Link to Minimal Reproducible Example

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

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added this to Needs Triage in 🐛 Bug Tracker Aug 3, 2022
@FredKSchott FredKSchott added - P3: minor bug An edge case that only affects very specific usage (priority) s1-small pkg: mdx Issues pertaining to `@astrojs/mdx` integration labels Aug 3, 2022
@natemoo-re natemoo-re assigned natemoo-re and unassigned bholmesdev Aug 3, 2022
🐛 Bug Tracker automation moved this from Needs Triage to Done Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) pkg: mdx Issues pertaining to `@astrojs/mdx` integration
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants