Skip to content
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

[Bug]: panic when using compilation.rebuildModule with CssExtractRspackPlugin #9058

Open
colinaaa opened this issue Jan 21, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@colinaaa
Copy link
Collaborator

System Info

System:
OS: macOS 14.6.1
CPU: (12) arm64 Apple M2 Max
Memory: 22.86 GB / 96.00 GB
Shell: 3.7.1 - /opt/homebrew/bin/fish
Binaries:
Node: 22.11.0 - ~/.local/state/fnm_multishells/55468_1736834119128/bin/node
npm: 10.9.0 - ~/.local/state/fnm_multishells/55468_1736834119128/bin/npm
pnpm: 9.15.2 - ~/.local/state/fnm_multishells/55468_1736834119128/bin/pnpm
Browsers:
Chrome: 131.0.6778.265
Safari: 17.6
npmPackages:
@rspack/cli: ^1.1.8 => 1.1.8
@rspack/core: ^1.1.8 => 1.1.8

Details

I'm trying to implement a Tailwind CSS V4 plugin for Rspack(see rspack-contrib/rsbuild-plugin-tailwindcss#17), and it panic when using Rspack.

Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues
Message:  should have event sender
Location: ./crates/rspack_core/src/compiler/module_executor/mod.rs:226

I called compilation.rebuildModule in the finishModules hook just like the documentation does. But it seems to crash when rebuilding a CSS module.

Reproduce link

https://github.com/colinaaa-reproductions/rspack-repro-rebuildModule-panic

Reproduce Steps

  1. Run pnpm install
  2. pnpm build:rspack <-- will panic here
@colinaaa colinaaa added bug Something isn't working pending triage The issue/PR is currently untouched. labels Jan 21, 2025
@chenjiahan chenjiahan removed the pending triage The issue/PR is currently untouched. label Jan 26, 2025
@chenjiahan
Copy link
Member

@JSerFeng cc~

@JSerFeng
Copy link
Contributor

Currently you should not use rebuildModule API, this is very unsafe as it will mutate the compilation module graph, if you invoke this multiple times, there is race condition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants