Skip to content

React compiler doesn't work with @svgr/webpack #79211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ellemedit opened this issue May 14, 2025 · 0 comments
Open

React compiler doesn't work with @svgr/webpack #79211

ellemedit opened this issue May 14, 2025 · 0 comments
Labels
Turbopack Related to Turbopack with Next.js. Webpack Related to Webpack with Next.js.

Comments

@ellemedit
Copy link

Link to the code that reproduces this issue

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

To Reproduce

  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

Current vs. Expected behavior

currently react compiler doesn't work if Turbopack(webpack too) and @svgr/webpack configured.

it should work together

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.4.0: Fri Apr 11 18:32:50 PDT 2025; root:xnu-11417.101.15~117/RELEASE_ARM64_T6041
  Available memory (MB): 131072
  Available CPU cores: 16
Binaries:
  Node: 22.14.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 9.15.9
Relevant Packages:
  next: 15.4.0-canary.34 // Latest available version is detected (15.4.0-canary.34).
  eslint-config-next: N/A
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.8.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Turbopack, Webpack

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local)

Additional context

No response

@github-actions github-actions bot added Turbopack Related to Turbopack with Next.js. Webpack Related to Webpack with Next.js. labels May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Turbopack Related to Turbopack with Next.js. Webpack Related to Webpack with Next.js.
Projects
None yet
Development

No branches or pull requests

1 participant