mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-26 23:49:51 +00:00
MDX: fix compatibility issues with Vite RSC
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'fumadocs-mdx': patch
|
||||
---
|
||||
|
||||
fix compatibility issues with Vite RSC
|
||||
@@ -96,6 +96,11 @@ export default async function mdx(
|
||||
});
|
||||
},
|
||||
async transform(value, id) {
|
||||
// Vite RSC will pass the compiled MDX file's client module with ID `virtual:vite-rsc/client-references/group/facade:xxx.mdx`.
|
||||
// The format of `value` becomes JavaScript, which will break the MDX compiler.
|
||||
// We have to ignore them.
|
||||
if (id.includes('virtual:vite-rsc')) return null;
|
||||
|
||||
try {
|
||||
if (metaLoader.filter(id)) {
|
||||
return await metaLoader.transform.call(this, value, id);
|
||||
|
||||
Reference in New Issue
Block a user