Skip to content

Codemod can mark a bare SVG component clean after its issuer changes to TSRX #2399

Closed

Description

@domgan-oai

Reproduction

With the React-to-Octane codemod, migrate this component with Strong mode and compiler verification enabled. The SVG can contain an ordinary gradient so that it is outside the path-only conversion subset.

import Mark from './mark.svg';
export function Badge() {
  return <div><Mark /></div>;
}

Use Rsbuild with @rsbuild/[email protected] and pluginSvgr({ svgrOptions: { exportType: 'default', svgo: false } }). With the plugin's stock issuer rules, a bare import of the same SVG returned a component function from a .tsx issuer and a data:image/svg+xml;base64,… string from a .tsrx issuer.

Actual behavior

The codemod emits Badge.tsrx with "use strong", preserves <Mark /> and the bare import, and reports zero errors. The renderer then receives an asset URL in the component position. The scoped-store migration currently checks the issuer change for components using its adapter. An ordinary component without that hook can encounter the same loader behavior.

Verified with the codemod at aa77e93c2 and Octane 0.16.7. The same reproduction held with and without the optional SVG conversion from #2398.

In a Chromium mount of this fixture, the React original produced one SVG. The compiled Octane output produced zero, and the browser raised InvalidCharacterError when the renderer passed the SVG data URI to document.createElement as a tag.

Expected behavior

Surface an actionable issuer diagnostic or migrate the component through a verified loader and renderer path. Compiling the resulting template alone does not establish that the bundler still supplies a component. Include an ordinary non-store consumer in regression coverage.

Activity

  1. added
    bug
    agent-authored
    on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-authoredbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions