kentcdodds / mdx-bundler

🦤 Give me MDX/TSX strings and I'll give you back a component you can render. Supports imports!
MIT License
1.77k stars 75 forks source link

next/dynamic #115

Open bradwoods opened 3 years ago

bradwoods commented 3 years ago

Has anyone successfully used mdx-bundler with next.js's dynamic importer? I get a Could not resolve path... error referencing the import path ('../components/hello3') in the example below.

const DynamicComponentWithNoSSR = dynamic(
  () => import('../components/hello3')
)
Arcath commented 2 years ago

Is this in your MDX file? or does that component import an MDX file?

bradwoods commented 2 years ago

A non-dynamic component is imported into an MDX file. Within that component, there is a dynamic component.