{"record":{"id":"65ef8dcd0f483b5b","repo":"withastro/astro","slug":"the-markdown-processor-processor-name-does-no","errorCode":null,"errorMessage":"The markdown processor \"${processor.name}\" does not provide MDX support. Implement `createMdxRenderer` on the processor to enable MDX rendering.","messagePattern":"The markdown processor \"(.+?)\" does not provide MDX support\\. Implement `createMdxRenderer` on the processor to enable MDX rendering\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/integrations/mdx/src/vite-plugin-mdx.ts","lineNumber":147,"sourceCode":"\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\tconst compiled = await unifiedProcessor.process(vfile);\n\t\t\t\tconst astroMetadata = getAstroMetadata(vfile);\n\t\t\t\tif (!astroMetadata) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t'Internal MDX error: Astro metadata is not set by rehype-analyze-astro-metadata',\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tcode: String(compiled.value),\n\t\t\t\t\tmap: compiled.map ? JSON.stringify(compiled.map) : null,\n\t\t\t\t\tastroMetadata,\n\t\t\t\t};\n\t\t\t},\n\t\t};\n\t}\n\n\tthrow new Error(\n\t\t`The markdown processor \"${processor.name}\" does not provide MDX support. ` +\n\t\t\t`Implement \\`createMdxRenderer\\` on the processor to enable MDX rendering.`,\n\t);\n}\n","sourceCodeStart":129,"sourceCodeEnd":152,"githubUrl":"https://github.com/withastro/astro/blob/d081033d5fe8e8a68c4bbbad4af9d2deb9c74bca/packages/integrations/mdx/src/vite-plugin-mdx.ts#L129-L152","documentation":"The MDX Vite plugin checks the configured markdown `processor` for a `createMdxRenderer` method. Astro's default processor implements it; custom processors (e.g. a custom remark/rehype pipeline passed as `markdown` config, or a Starlight-typography-style processor) may not. If absent, the plugin throws a plain `Error` instructing the user to implement `createMdxRenderer`.","triggerScenarios":"Setting `astro.config` `markdown` to a custom processor object (via `markdown.shikiApplyStyle` alternatives, custom processor injection, or an integration that swaps the processor) that lacks `createMdxRenderer`. Using `@astrojs/starlight` or another integration that customizes markdown in a way incompatible with MDX. Mismatched `@astrojs/mdx` and Astro core versions.","commonSituations":"Custom markdown processor integrations. Version skew between `astro` and `@astrojs/mdx`. Forking the markdown pipeline without re-implementing the MDX renderer contract.","solutions":["If you pass a custom processor, add a `createMdxRenderer` method that returns an object with a `render(body, opts)` function returning `{ code, map, astroMetadata }`.","Remove the custom processor override and let Astro's built-in processor handle MDX.","Align `astro` and `@astrojs/mdx` to compatible versions (check the integration's peerDeps)."],"exampleFix":"// before — custom processor missing the MDX contract\nexport const processor = { name: 'mine', render: async () => ({ code: '' }) };\n\n// after\nexport const processor = {\n  name: 'mine',\n  async render() { /* ... */ return { code, map, astroMetadata }; },\n  createMdxRenderer() {\n    return { render(body) { /* produce code/map/astroMetadata */ } };\n  },\n};","handlingStrategy":"type-guard","validationCode":"function processorSupportsMdx(processor: any): boolean {\n  return typeof processor?.createMdxRenderer === 'function';\n}\nif (!processorSupportsMdx(config.markdown?.processor)) {\n  throw new Error('Custom processor lacks createMdxRenderer — MDX will fail');\n}","typeGuard":"function hasMdxRenderer(p: unknown): p is { createMdxRenderer: () => { render: Function } } {\n  return !!p && typeof (p as any)?.createMdxRenderer === 'function';\n}","tryCatchPattern":null,"preventionTips":["If you supply a custom markdown processor, implement `createMdxRenderer`.","Keep `astro` and `@astrojs/mdx` on compatible versions.","Prefer extending the built-in processor over replacing it."],"tags":["mdx","markdown","configuration","integrations","build"],"backgroundTag":null,"analyzedSha":"d081033d5fe8e8a68c4bbbad4af9d2deb9c74bca","analyzedAt":"2026-08-12T13:37:29.035Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}