diff --git a/.changeset/tasty-waves-film.md b/.changeset/tasty-waves-film.md new file mode 100644 index 000000000000..c39b2e7fe1e7 --- /dev/null +++ b/.changeset/tasty-waves-film.md @@ -0,0 +1,5 @@ +--- +'@astrojs/mdx': patch +--- + +Fixes an incompatibility where `@astrojs/mdx` v8 could be installed with `astro` versions that bundle an older `@astrojs/markdown-satteri` lacking MDX support. Also improves the error message when the processor is too old to suggest updating `astro` itself. diff --git a/packages/integrations/mdx/package.json b/packages/integrations/mdx/package.json index 773ede9d7e42..aa05c7eb7c3b 100644 --- a/packages/integrations/mdx/package.json +++ b/packages/integrations/mdx/package.json @@ -41,7 +41,7 @@ "peerDependencies": { "@astrojs/markdown-remark": "^7.3.0", "@astrojs/markdown-satteri": "^0.4.0", - "astro": "^7.2.6" + "astro": "^7.2.10" }, "peerDependenciesMeta": { "@astrojs/markdown-remark": { diff --git a/packages/integrations/mdx/src/vite-plugin-mdx.ts b/packages/integrations/mdx/src/vite-plugin-mdx.ts index e8a97d28ba7a..81d0ca9ef628 100644 --- a/packages/integrations/mdx/src/vite-plugin-mdx.ts +++ b/packages/integrations/mdx/src/vite-plugin-mdx.ts @@ -100,7 +100,7 @@ const BUILT_IN_PROCESSOR_PACKAGES: Record = { function mdxUnsupportedMessage(name: string): string { const pkg = BUILT_IN_PROCESSOR_PACKAGES[name]; if (pkg) { - return `\`${pkg}\` is too old to render \`.mdx\` files. Update it to the latest version — a \`^\` range on an older version will not pick it up:\n npm install ${pkg}@latest`; + return `\`${pkg}\` is too old to render \`.mdx\` files. Update it to the latest version:\n npm install ${pkg}@latest`; } return `The markdown processor "${name}" does not provide MDX support. Implement \`createMdxRenderer\` on the processor to enable MDX rendering.`; }