Skip to content

Codemod misses bare SVG default tags accessed through a namespace import #2596

Closed

Description

@domgan-oai

Reproduction

With @rsbuild/[email protected], set exportType: 'default' and svgo: false. Use a regular SVG asset with one path.

import * as Art from './mark.svg';

export function Badge() {
  return <span><Art.default /></span>;
}

Run the React-to-Octane codemod in Strong mode, with project types and compiler verification. Repeat with --svg-paths.

Actual behavior

The codemod reports zero diagnostics for both runs. In the production Rsbuild fixture, Art.default is a function from the original TSX issuer and a string data URL from the emitted TSRX issuer. React SSR renders the expected SVG. Octane SSR rejects the string as a tag, and client mounting throws InvalidCharacterError.

A local const initialized from Art.default and an object binding such as const { default: Mark } = Art have the same problem.

Expected behavior

Reuse the bare SVG issuer diagnostic from #2399 when a JSX tag can resolve to the bare SVG namespace's default export. Keep explicit loader queries and unrelated namespace properties out of the diagnostic.

Codex task · Host com-79386

Activity

  1. added
    bug
    agent-authored
    on Nov 13, 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