{"record":{"id":"38e0600d45b60d8d","repo":"parcel-bundler/parcel","slug":"unsupported-svgr-option-jsx","errorCode":null,"errorMessage":"Unsupported SVGR option \"jsx\".","messagePattern":"Unsupported SVGR option \"jsx\"\\.","errorType":"exception","errorClass":"ThrowableDiagnostic","httpStatus":null,"severity":"error","filePath":"packages/transformers/svg-jsx/src/SvgJsxTransformer.js","lineNumber":49,"sourceCode":"    ]);\n\n    let contents = svgrResult?.contents?.svgoConfig ?? svgoResult?.contents;\n    let svgoConfig: any = {default: true};\n    if (contents) {\n      svgoConfig = await convertSVGOConfig(\n        contents,\n        svgrResult?.contents?.svgoConfig\n          ? svgrResult.filePath\n          : svgoResult.filePath,\n        svgrResult?.contents?.svgoConfig ? '/svgoConfig' : '',\n        options.inputFS,\n        'Use the legacy @parcel/transformer-svg-react instead of @parcel/transformer-svg-jsx if needed.',\n      );\n    }\n\n    let svgr = svgrResult?.contents;\n    if (svgoResult && svgr?.jsx) {\n      throw new ThrowableDiagnostic({\n        diagnostic: await createDiagnostic(\n          md`\nUnsupported SVGR option \"jsx\".\n          `,\n          svgrResult.filePath,\n          '/jsx',\n          options,\n        ),\n      });\n    }\n\n    if (svgr?.template) {\n      throw new ThrowableDiagnostic({\n        diagnostic: await createDiagnostic(\n          md`\nUnsupported SVGR option \"template\".\n          `,\n          svgrResult.filePath,","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/parcel-bundler/parcel/blob/59484858a1a0bcbb71f74088956bb437a2db6505/packages/transformers/svg-jsx/src/SvgJsxTransformer.js#L31-L67","documentation":"Thrown by @parcel/transformer-svg-jsx when the SVGR config (`.svgrrc`, `svgr.config.js`, etc.) contains a `jsx: true` (or truthy) option. The new SVG-JSX transformer is powered by @parcel/rust's svgReact and does not implement SVGR's `jsx` flag (which toggles outputting raw JSX vs React.createElement in legacy SVGR). It raises a ThrowableDiagnostic pointing at the `/jsx` JSON path and suggests falling back to the legacy @parcel/transformer-svg-react.","triggerScenarios":"loadConfig parses an SVGR config file and finds `svgr.jsx` truthy. Triggered once per build for the project that has such a config (loadConfig is cached).","commonSituations":"Migrating to Parcel 2's default svg-jsx transformer while keeping an old `.svgrrc` with `jsx: true`; copying config from an SVGR-based project.","solutions":["Remove the `jsx` option from your SVGR config file (the new transformer always emits JSX).","If you truly need legacy SVGR behavior (e.g. jsx:false -> React.createElement output), switch the transformer in .parcelrc to the legacy @parcel/transformer-svg-react as the diagnostic suggests."],"exampleFix":"// before: .svgrrc\n{ \"jsx\": true, \"icon\": true }\n// after\n{ \"icon\": true }","handlingStrategy":"validation","validationCode":"function assertNoLegacySVGROptions(config) {\n  if (config?.jsx) {\n    throw new Error('.svgrrc: jsx is not supported by @parcel/transformer-svg-jsx; remove it or switch to @parcel/transformer-svg-react');\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When migrating from SVGR, audit the config for jsx/template/options that the new rust-based transformer does not support.","Prefer the default svgReact output; only keep the legacy transformer if you have a hard dependency."],"tags":["svg","svgr","config","transformer","migration"],"backgroundTag":null,"analyzedSha":"59484858a1a0bcbb71f74088956bb437a2db6505","analyzedAt":"2026-08-13T04:06:35.925Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}