web-infra-dev / rspack

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

[Bug]: RebuildModule frequent failures #8402

Open Geylnu opened 2 weeks ago

Geylnu commented 2 weeks ago

System Info

System: OS: macOS 15.0.1 CPU: (8) arm64 Apple M1 Memory: 83.17 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 18.20.2 - /usr/local/bin/node Yarn: 1.22.21 - ~/node_modules/.bin/yarn npm: 10.5.0 - /usr/local/bin/npm bun: 1.1.27 - ~/.bun/bin/bun Browsers: Chrome: 130.0.6723.117 Safari: 18.0.1

Details

Executing “rebuildModule” always fails when the dependency has more than one file.

这个问题是偶现的,不更改代码的情况下,有50%的概率构建失败,失败的概率似乎会随着文件的增多而增大,在我的业务项目中,从未成功过。 —————————— The problem is episodic, with a 50% probability of build failure without code changes, the probability of failure seems to increase with more files, and has never worked in my business projects.

Reproduce link

https://github.com/Geylnu/rspack-rebuild-issue

Reproduce Steps

yarn build

Image

Geylnu commented 2 weeks ago

Image

我再次尝试构建了多次,构建又成功了,但是我添加了一个新的文件“layout.tsx”,再次构建,这次失败了。我重试了一下,构建又成功了,看起来似乎和缓存有关 —————————————————————— I tried the build again multiple times and the build worked again, but I added a new file “layout.tsx” and built it again and this time it failed. I retried and the build worked again, it looks like it has something to do with caching.