Using mdx-bundler, can I not import a file which imports another file?
Right now, in my .mdx
file I do:
import MyComponent from './MyComponent'
This is my *mdx* file.
<MyComponent />
This works, when <MyComponent />
looks like this:
const MyComponent = () => {
return <div>Hello</div>
}
export default MyComponent
However, once I import something, it will fail. So when I change <MyComponent />
to this:
import AnotherBasicComponent from './AnotherBasicComponent'
const MyComponent = () => {
return <div>
<AnotherBasicComponent />
</div>
}
export default MyComponent
I get:
SyntaxError: Unexpected token '<' at new Function () at getMDXExport (/Users/anton/projects/superdoo/node_modules/.pnpm/mdx-bundler@9.2.1_esbuild@0.15.18/node_modules/mdx-bundler/dist/client.js:44:14) at getMDXComponent (/Users/anton/projects/superdoo/node_modules/.pnpm/mdx-bundler@9.2.1_esbuild@0.15.18/node_modules/mdx-bundler/dist/client.js:24:21)