{"record":{"id":"30ed712eb5d90ab5","repo":"withastro/astro","slug":"names-on-mdx-isplural-are-is","errorCode":null,"errorMessage":"${names} on `mdx({...})` ${isPlural ? 'are' : 'is'} deprecated. Pass ${isPlural ? 'them' : 'it'} to `unified({...})` from `@astrojs/markdown-remark` and set it as `markdown.processor` instead — MDX will inherit ${isPlural ? 'them' : 'it'}. Will be removed in a future major.","messagePattern":"(.+?) on `mdx\\((.+?)\\)` (.+?) deprecated\\. Pass (.+?) to `unified\\((.+?)\\)` from `@astrojs/markdown-remark` and set it as `markdown\\.processor` instead — MDX will inherit (.+?)\\. Will be removed in a future major\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/integrations/mdx/src/index.ts","lineNumber":287,"sourceCode":"\t\t};\n\t}\n\treturn {};\n}\n\nlet didWarnAboutDeprecatedMdxPluginOptions = false;\n\nfunction warnDeprecatedMdxPluginOptions(\n\toptions: Partial<MdxOptions>,\n\tlogger: AstroIntegrationLogger,\n): void {\n\tif (didWarnAboutDeprecatedMdxPluginOptions) return;\n\tconst deprecated = LEGACY_PLUGIN_OPTIONS.filter((key) => options[key] !== undefined);\n\tif (deprecated.length === 0) return;\n\tdidWarnAboutDeprecatedMdxPluginOptions = true;\n\n\tconst names = deprecated.map((key) => `\\`${key}\\``).join(', ');\n\tconst isPlural = deprecated.length > 1;\n\tlogger.warn(\n\t\t`${names} on \\`mdx({...})\\` ${isPlural ? 'are' : 'is'} deprecated. ` +\n\t\t\t`Pass ${isPlural ? 'them' : 'it'} to \\`unified({...})\\` from \\`@astrojs/markdown-remark\\` ` +\n\t\t\t`and set it as \\`markdown.processor\\` instead — MDX will inherit ${isPlural ? 'them' : 'it'}. ` +\n\t\t\t'Will be removed in a future major.',\n\t);\n}\n\nfunction applyDefaultOptions({\n\toptions,\n\tdefaults,\n}: {\n\toptions: Partial<MdxOptions>;\n\tdefaults: ResolvedMdxOptions;\n}): ResolvedMdxOptions {\n\treturn {\n\t\tsyntaxHighlight: options.syntaxHighlight ?? defaults.syntaxHighlight,\n\t\tshikiConfig: options.shikiConfig ?? defaults.shikiConfig,\n\t\tgfm: options.gfm ?? defaults.gfm,","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/withastro/astro/blob/e294953aa8aadd98d5be92e60a03037b05dbdfd4/packages/integrations/mdx/src/index.ts#L269-L305","documentation":"Passing remarkPlugins, rehypePlugins, or remarkRehype directly to mdx() is deprecated: the integration detects any of the three keys and warns once per process (didWarnAboutDeprecatedMdxPluginOptions). Markdown/MDX option handling was consolidated into the unified() helper exported by @astrojs/markdown-remark — configure the options there and assign the result to markdown.processor in astro.config; MDX inherits that processor's configuration.","triggerScenarios":"`integrations: [mdx({ remarkPlugins: [...], rehypePlugins: [...] })]` (or remarkRehype) in astro.config.mjs. Any one of the three keys being present triggers the single warning, no matter what values they hold.","commonSituations":"Long-standing configs predating the processor unification; adding a remark/rehype plugin intended for MDX and placing it in the integration options; upgrading @astrojs/mdx and @astrojs/markdown-remark majors together.","solutions":["Import { unified } from '@astrojs/markdown-remark' and pass the plugin options to it","Assign the result to markdown.processor in astro.config: markdown: { processor: unified({ remarkPlugins, rehypePlugins }) }","Remove the deprecated keys from mdx({...}) so configuration has a single source of truth","Rebuild and confirm MDX output still applies the plugins (they are inherited through the shared processor)"],"exampleFix":"// before\nimport mdx from '@astrojs/mdx';\nexport default defineConfig({\n  integrations: [mdx({ remarkPlugins: [pluginA], rehypePlugins: [pluginB] })],\n});\n\n// after\nimport mdx from '@astrojs/mdx';\nimport { unified } from '@astrojs/markdown-remark';\nexport default defineConfig({\n  markdown: { processor: unified({ remarkPlugins: [pluginA], rehypePlugins: [pluginB] }) },\n  integrations: [mdx()],\n});","handlingStrategy":"validation","validationCode":"// Guard in astro.config.mjs: reject deprecated mdx() options at load time\nconst mdxOptions: Record<string, unknown> = {};\nfor (const k of ['remarkPlugins', 'rehypePlugins', 'remarkRehype']) {\n  if (k in mdxOptions) throw new Error(`mdx({ ${k} }) is deprecated — use markdown.processor via unified()`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep markdown/MDX plugin configuration in one place (markdown.processor with unified()) from the start","Grep astro.config for the three deprecated keys whenever upgrading @astrojs/mdx","Read integration changelogs before major version bumps"],"tags":["mdx","markdown","deprecation","remark-plugins","rehype-plugins","config"],"backgroundTag":"deprecated-option-migration","analyzedSha":"e294953aa8aadd98d5be92e60a03037b05dbdfd4","analyzedAt":"2026-08-18T18:48:03.901Z","contentChangedAt":"2026-08-18T18:48:03.901Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}