{"record":{"id":"4e8468fa28d8b5a1","repo":"mdx-js/mdx","slug":"unexpected-deprecated-option-jsxruntime-classic","errorCode":null,"errorMessage":"Unexpected deprecated option `jsxRuntime: 'classic'`, `pragma`, `pragmaFrag`, or `pragmaImportSource`; see <https://mdxjs.com/migrating/v3/> on how to migrate","messagePattern":"Unexpected deprecated option `jsxRuntime: 'classic'`, `pragma`, `pragmaFrag`, or `pragmaImportSource`; see <https://mdxjs\\.com/migrating/v3/> on how to migrate","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/mdx/lib/core.js","lineNumber":192,"sourceCode":"  }\n\n  // @ts-expect-error: throw an error for a runtime value which is not allowed\n  // by the types.\n  if (settings.format === 'detect') {\n    unreachable(\n      \"Unexpected `format: 'detect'`, which is not supported by `createProcessor`, expected `'mdx'` or `'md'`\"\n    )\n  }\n\n  if (\n    (settings.jsxRuntime === 'classic' ||\n      settings.pragma ||\n      settings.pragmaFrag ||\n      settings.pragmaImportSource) &&\n    !warned\n  ) {\n    warned = true\n    console.warn(\n      \"Unexpected deprecated option `jsxRuntime: 'classic'`, `pragma`, `pragmaFrag`, or `pragmaImportSource`; see <https://mdxjs.com/migrating/v3/> on how to migrate\"\n    )\n  }\n\n  const pipeline = unified().use(remarkParse)\n\n  if (settings.format !== 'md') {\n    pipeline.use(remarkMdx)\n  }\n\n  const remarkRehypeOptions = settings.remarkRehypeOptions || {}\n\n  pipeline\n    .use(remarkMarkAndUnravel)\n    .use(settings.remarkPlugins || [])\n    .use(remarkRehype, {\n      ...remarkRehypeOptions,\n      allowDangerousHtml: true,","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/mdx-js/mdx/blob/685627a819567c0788eadb85f5f57065bcc81c2c/packages/mdx/lib/core.js#L174-L210","documentation":"This is not a thrown error but a deprecation warning emitted once by createProcessor (the core of `compile`/`compileSync`) when legacy v1/v2 options — `jsxRuntime: 'classic'`, `pragma`, `pragmaFrag`, or `pragmaImportSource` — are passed to the MDX v3 core. In v3 the classic pragma configuration was replaced by ESM import/source configuration, so these options are ignored and the user is pointed to the migration guide.","triggerScenarios":"Calling `compile`/`compileSync`/processor with `jsxRuntime: 'classic'` or any of `pragma`, `pragmaFrag`, `pragmaImportSource` in the options (typically a carried-over v2 config).","commonSituations":"Upgrading mdx-js from v2 to v3 without updating config; tutorials or blog posts referencing the old classic-runtime API; monorepos where one package still sets pragma options shared with the MDX pipeline.","solutions":["Remove `jsxRuntime: 'classic'`, `pragma`, `pragmaFrag`, and `pragmaImportSource` from your options and follow https://mdxjs.com/migrating/v3/.","If you need automatic-runtime customization, use `jsxImportSource` (e.g. `jsxImportSource: 'preact'`) instead of pragma options.","If you truly need the classic runtime, configure it via the underlying `@mdx-js/mdx` recma plugins per the v3 migration guide, or stay on the older major version."],"exampleFix":"// before\nawait compile(file, { jsxRuntime: 'classic', pragma: 'h', pragmaImportSource: 'preact' })\n// after\nawait compile(file, { jsxImportSource: 'preact' })","handlingStrategy":"validation","validationCode":"const legacyKeys = ['jsxRuntime', 'pragma', 'pragmaFrag', 'pragmaImportSource']\nconst found = legacyKeys.filter((k) => k in (mdxOptions || {}))\nif (found.length) console.warn('Deprecated MDX options detected, migrate per v3 guide:', found)","typeGuard":"function usesLegacyMdxOptions(o) {\n  return typeof o === 'object' && o !== null &&\n    ['jsxRuntime', 'pragma', 'pragmaFrag', 'pragmaImportSource'].some((k) => k in o)\n}","tryCatchPattern":null,"preventionTips":["Audit MDX options when upgrading majors; delete `jsxRuntime: 'classic'`, `pragma`, `pragmaFrag`, `pragmaImportSource`.","Use `jsxImportSource` for custom JSX libraries under the automatic runtime.","Read https://mdxjs.com/migrating/v3/ as part of the upgrade checklist.","Treat the one-time console.warn as a build failure in CI by capturing console.warn during a compile smoke test."],"tags":["mdx","deprecation","migration"],"backgroundTag":"deprecated-option","analyzedSha":"685627a819567c0788eadb85f5f57065bcc81c2c","analyzedAt":"2026-09-02T16:11:18.599Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}