web-infra-dev / rspack

The fast Rust-based web bundler with webpack-compatible API 🦀️
https://rspack.dev
MIT License
9.7k stars 559 forks source link

Unable to compile virtuoso #3774

Closed paveldvorak5 closed 1 year ago

paveldvorak5 commented 1 year ago

System Info

System: OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm) CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13900K Memory: 29.89 GB / 62.55 GB Container: Yes Shell: 5.9 - /bin/zsh Binaries: Node: 16.18.1 - ~/.nvm/versions/node/v16.18.1/bin/node Yarn: 3.6.1 - ~/.nvm/versions/node/v16.18.1/bin/yarn npm: 8.19.2 - ~/.nvm/versions/node/v16.18.1/bin/npm Watchman: 4.9.0 - /bin/watchman Browsers: Chromium: 114.0.5735.198 npmPackages: @rspack/cli: ^0.2.7 => 0.2.7

Details

Uncaught TypeError: n is not a function

unable to build react-virtuoso, dev server works, just not production build

I had trouble with template bellow, so I changed it

Reproduce link

https://github.com/paveldvorak5/virtuoso

Reproduce Steps

  1. yarn preview
  2. Uncaught TypeError: n is not a function in the browser console
IWANABETHATGUY commented 1 year ago

Looks like it is a minification issue : image

hardfist commented 1 year ago

it works when you disable swc minify, so it's a swc minify bug,

{
  optimization:{ minimize:false}
}

can you help file a issue to swc?

paveldvorak5 commented 1 year ago

Hello, do you know what they want? https://github.com/swc-project/swc/issues/7802 Thanks

hardfist commented 1 year ago

disable the minify of rspack and paste the unminified result of the build to swc playground and see whether swc error

gxy01 commented 1 year ago

@paveldvorak5 seems like the lastest swc fix this issue. rspack need to update their deps