Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug]: passing props onto .mdx component breaks rendering #1555

Open
JounQin opened this issue Nov 5, 2024 · 1 comment
Open

[Bug]: passing props onto .mdx component breaks rendering #1555

JounQin opened this issue Nov 5, 2024 · 1 comment
Labels
🐞 bug Something isn't working

Comments

@JounQin
Copy link
Contributor

JounQin commented Nov 5, 2024

Version

System:
OS: macOS 15.1
CPU: (10) arm64 Apple M1 Max
Memory: 5.05 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Browsers:
Chrome: 130.0.6723.92
Safari: 18.1
npmPackages:
@rspress/core: ^1.35.3 => 1.35.3

Details

import Test from '../components/Test.mdx'

<Test />

<Test color="red" />

<Test /> renders normally, <Test color="red" /> results:

Uncaught Error: Expected component `Test` to be defined: you likely forgot to import, pass, or provide it.

https://mdxjs.com/docs/using-mdx/#props

Reproduce link

https://codesandbox.io/p/devbox/xenodochial-david-52cfy2?file=%2Fdocs%2Findex.mdx%3A5%2C21

Reproduce Steps

  1. run npm i && npm dev
  2. check the error logs
@JounQin JounQin added the 🐞 bug Something isn't working label Nov 5, 2024
@Timeless0911
Copy link
Contributor

Currently, the processing of nested mdx is simple flatting, so this feature is not supported yet.

https://github.com/web-infra-dev/rspress/blob/main/packages/core/src/node/utils/flattenMdxContent.ts

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants