mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #659] rsc:scan-strip parses MDX files as JS before @mdx-js/rollup transforms them, causing parse errors #138
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#138
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @keufcp on GitHub (Mar 22, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/659
Environment
Problem
When using
import.meta.globto dynamically load MDX files in an RSC page,the
rsc:scan-stripplugin attempts to parse.mdxfiles as JavaScriptbefore
@mdx-js/rolluphas a chance to transform them. This causes a parse error.Error
The MDX files contain standard frontmatter (YAML between
---) and JSX syntax(e.g.
<span className='text-red-500'>), which are valid MDX but invalid JavaScript.Root cause
rsc:scan-stripruns before@mdx-js/rollupin the plugin pipeline,so it sees raw MDX instead of the transformed JS output.
Reproduction
import.meta.glob('/src/content/posts/**/*.mdx')in a lib filevite buildExpected behavior
@mdx-js/rollupshould transform MDX files to JS beforersc:scan-stripprocesses them,or
rsc:scan-stripshould skip non-JS files that will be handled by other plugins.Workaround
None found without changing the content file structure.
[plugin rsc:use-client] unsupported ExportAllDeclaration#182