Skip to content

Commit f4444eb

Browse files
astro-factory[bot]factory[bot]Princesseuh
authored
Tighten @astrojs/mdx peer dependency on astro and improve version mismatch error message (#18036)
Co-authored-by: factory[bot] <factory[bot]@users.noreply.github.com> Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
1 parent 2245837 commit f4444eb

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎.changeset/tasty-waves-film.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@astrojs/mdx': patch
3+
---
4+
5+
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.

‎packages/integrations/mdx/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"peerDependencies": {
4242
"@astrojs/markdown-remark": "^7.3.0",
4343
"@astrojs/markdown-satteri": "^0.4.0",
44-
"astro": "^7.2.6"
44+
"astro": "^7.2.10"
4545
},
4646
"peerDependenciesMeta": {
4747
"@astrojs/markdown-remark": {

‎packages/integrations/mdx/src/vite-plugin-mdx.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const BUILT_IN_PROCESSOR_PACKAGES: Record<string, string> = {
100100
function mdxUnsupportedMessage(name: string): string {
101101
const pkg = BUILT_IN_PROCESSOR_PACKAGES[name];
102102
if (pkg) {
103-
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`;
103+
return `\`${pkg}\` is too old to render \`.mdx\` files. Update it to the latest version:\n npm install ${pkg}@latest`;
104104
}
105105
return `The markdown processor "${name}" does not provide MDX support. Implement \`createMdxRenderer\` on the processor to enable MDX rendering.`;
106106
}

0 commit comments

Comments
 (0)
⌂ 换网址