parcel-bundler/parcel · error · ThrowableDiagnostic
Unsupported SVGR option "jsx".
Error message
Unsupported SVGR option "jsx".
What it means
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.
Source
Thrown at packages/transformers/svg-jsx/src/SvgJsxTransformer.js:49
]);
let contents = svgrResult?.contents?.svgoConfig ?? svgoResult?.contents;
let svgoConfig: any = {default: true};
if (contents) {
svgoConfig = await convertSVGOConfig(
contents,
svgrResult?.contents?.svgoConfig
? svgrResult.filePath
: svgoResult.filePath,
svgrResult?.contents?.svgoConfig ? '/svgoConfig' : '',
options.inputFS,
'Use the legacy @parcel/transformer-svg-react instead of @parcel/transformer-svg-jsx if needed.',
);
}
let svgr = svgrResult?.contents;
if (svgoResult && svgr?.jsx) {
throw new ThrowableDiagnostic({
diagnostic: await createDiagnostic(
md`
Unsupported SVGR option "jsx".
`,
svgrResult.filePath,
'/jsx',
options,
),
});
}
if (svgr?.template) {
throw new ThrowableDiagnostic({
diagnostic: await createDiagnostic(
md`
Unsupported SVGR option "template".
`,
svgrResult.filePath,View on GitHub (pinned to 59484858a1)
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.
Example fix
// before: .svgrrc
{ "jsx": true, "icon": true }
// after
{ "icon": true } Defensive patterns
Strategy: validation
Validate before calling
function assertNoLegacySVGROptions(config) {
if (config?.jsx) {
throw new Error('.svgrrc: jsx is not supported by @parcel/transformer-svg-jsx; remove it or switch to @parcel/transformer-svg-react');
}
} Prevention
- 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.
When it happens
Trigger: 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).
Common situations: Migrating to Parcel 2's default svg-jsx transformer while keeping an old `.svgrrc` with `jsx: true`; copying config from an SVGR-based project.
Related errors
- Unsupported SVGR option "template".
- Unsupported custom SVGO plugin.
- The 'elm.json' file is missing.
- PostCSS config should be an object.
- PostCSS config must have plugins
AI-assisted analysis of parcel-bundler/parcel@59484858a1 (2026-08-13).
Data as JSON: /api/errors/38e0600d45b60d8d.
Report an issue: GitHub.