Replies: 1 comment 11 replies
-
@karlhorky Thank you for sharing your thoughts! I moved this over to discussions because this doesn't necessarily seem like an issue with incorrect information with our documentation. I'm actually not 100% familiar with all the capabilities with |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is the documentation issue?
Since a few months / years, I have encountered articles such as MDX in Next.js - Space Jelly by @colbyfayock which are based on the (incorrect) assumption that
@next/mdx
cannot pull in content from other sources such as files outside of theapp
directory:This is an incorrect assumption, as files outside of the
app
directory can be pulled in via static imports and dynamicimport()
:import
next.js/examples/app-dir-mdx/app/page.tsx
Line 4 in 3127e86
import()
Apart from the aforementioned blog posts, there seems to be a bunch of community confusion on what is possible using
@next/mdx
:Even the Next.js MDX docs section "Remote MDX" seem to (incorrectly) implicitly indicate that
@next/mdx
cannot pull in content from other sources such as files outside of theapp
directory:@next/mdx
can achieve the same things asnext-mdx-remote
andmdx-bundler
andrsc-mdx
, without the significant, non-obvious downsides with the alternatives:next-mdx-remote/rsc
doesn't allow for importing MDX files within MDX filesmdx-bundler
requires complicated manual configuration to share components to imported.mdx
files (not to mention pulling in a bunch of extra bundling dependencies and running the bundling outside of the existing webpack / Turbopack bundler config)cc @manovotny @leerob @wooorm @remcohaszing
Is there any context that might help us understand?
I'm hoping the context is included above. I can add more if needed.
Does the docs page already exist? Please link to it.
https://nextjs.org/docs/app/building-your-application/configuring/mdx
Beta Was this translation helpful? Give feedback.
All reactions