Skip to content

[Compiler Bug]: compiler doesn't work with @svgr/webpack #33198

@ellemedit

Description

@ellemedit

What kind of issue is this?

  • React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization)
  • babel-plugin-react-compiler (build issue installing or using the Babel plugin)
  • eslint-plugin-react-compiler (build issue installing or using the eslint plugin)
  • react-compiler-healthcheck (build issue installing or using the healthcheck script)

Link to repro

https://github.com/ellemedit/nextjs-react-compiler-not-work

Repro steps

  1. bun dev
  2. open with React devtools
  3. you can see component not memoized even react compiler configured:
    Image
  4. then you can edit app/IconButton.tsx to:
    "use client";
    
    import { ComponentProps } from "react";
    
    export function IconButton({ children, ...props }: ComponentProps<"button">) {
      return <button {...props}>{children}</button>;
    }
    
  5. Cmd + K and rerun bun dev
  6. you can see component is memoized:
    Image

both Turbopack and webpack behave same.

How often does this bug happen?

Every time

What version of React are you using?

19.2.0

What version of React Compiler are you using?

rc.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions