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

Importing Components that import other Components #212

Open
dominik-sfl opened this issue Apr 30, 2023 · 2 comments
Open

Importing Components that import other Components #212

dominik-sfl opened this issue Apr 30, 2023 · 2 comments

Comments

@dominik-sfl
Copy link

  • mdx-bundler version: 9.2.1
  • node version: 16.19.0
  • npm version: 8.19.3

What you did:

I am importing a component into my mdx blog post:

import Imper from "./Imper";

Hello!

<Imper />

When Imper does not rely on any other components from my own project, this works. However, when I import other components inside Imper (that are not provided as globals), I get this error:

Server Error
SyntaxError: Unexpected token '<'

This error happened while generating the page. Any console logs will be displayed in the terminal window.

I am not sure whether this is intended or what I am doing wrong here exactly? I would've expected mdx-bundler to automatically import all other components that my Imper component relies on?

I do know that providing those components as globals fixes this problem, but I do not want to have a ton of globals that I might not re-use a lot.

@xiaojundebug
Copy link

Did you solve it?

@yswrepos
Copy link

Adding my +1 here, I'm facing the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants