Skip to content

Enabling React Compiler breaks JSX pragma handling #1224

@swandir

Description

@swandir

Related plugins

Describe the bug

React Compiler integration, as documented by the plugin, is not compatible with JSX pragma usage (e.g Emotion css prop).

React Compiler adds an import statement at the top of the file (playground).

This causes Oxc to skip the pragma (playground).

Interestingly, Babel handles this case fine (playground), while TypeScript matches Oxc's behavior (playground).

Reproduction

https://stackblitz.com/edit/vitejs-vite-9eantx6h

Steps to reproduce

No response

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 22.22.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @vitejs/plugin-react: ^6.0.1 => 6.0.1 
    vite: ^8.0.12 => 8.0.12

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions