web-infra-dev / rspack

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

[Bug]: hitting a panic when saving file changes while running with --watch enabled #8383

Open klinakerdisy opened 1 week ago

klinakerdisy commented 1 week ago

System Info

System: OS: macOS 14.7.1 CPU: (10) arm64 Apple M1 Max Memory: 15.02 GB / 64.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 16.20.1 - ~/.volta/tools/image/node/16.20.1/bin/node npm: 8.19.4 - ~/.volta/tools/image/node/16.20.1/bin/npm pnpm: 8.15.6 - ~/Library/pnpm/pnpm Browsers: Chrome: 130.0.6723.117 Edge: 130.0.2849.80 Safari: 18.1 npmPackages: @rspack/cli: 1.1.0 => 1.1.0 @rspack/core: 1.1.0 => 1.1.0

Details

Hi, I started hitting a panic when saving file changes under normal development conditions while running with --watch enabled. The issues started after updating @rspack/cli and @rspack/core from 1.0.14 -> 1.1.0.

Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues
Message:  Chunk should be added before
Location: crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs:185

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 1: _napi_register_module_v1
    at <unknown source file>
 2: _napi_register_module_v1
    at <unknown source file>
 3: _napi_register_module_v1
    at <unknown source file>
 4: _napi_register_module_v1
    at <unknown source file>
 5: _wasmer_vm_f64_nearest
    at <unknown source file>
 6: _wasmer_vm_f64_nearest
    at <unknown source file>
 7: _napi_register_module_v1
    at <unknown source file>
 8: _napi_register_module_v1
    at <unknown source file>
 9: _napi_register_module_v1
    at <unknown source file>
10: _napi_register_module_v1
    at <unknown source file>
11: _napi_register_module_v1
    at <unknown source file>
12: _napi_register_module_v1
    at <unknown source file>
13: _napi_register_module_v1
    at <unknown source file>
14: _napi_register_module_v1
    at <unknown source file>
15: __pthread_joiner_wake
    at <unknown source file>
 ELIFECYCLE  Command failed with exit code 129.

Reproduce link

No response

Reproduce Steps

  1. Run pnpm run rspack --watch.
  2. Make a change to a file and hit save.

Unfortunately it doesn't always happen and there is no obvious pattern to when it does. A colleague of mine could reproduce it on his x86 Linux system so it's not macOS specific.

GiveMe-A-Name commented 1 week ago

Can you provide a produce repo?

github-actions[bot] commented 1 week ago

Hello @klinakerdisy, sorry we can't investigate the problem further without reproduction demo, please provide a repro demo by forking rspack-repro, or provide a minimal GitHub repository by yourself. Issues labeled by need reproduction will be closed if no activities in 14 days.