rspack: [Bug]: Production build panics by cssExtractPlugin after upgrading to 1.3.0
System Info
System: OS: macOS 15.3.1 CPU: (12) arm64 Apple M2 Pro Memory: 239.50 MB / 32.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.10.0 - ~/n/bin/node Yarn: 3.3.0 - ~/n/bin/yarn npm: 10.2.3 - ~/n/bin/npm Browsers: Brave Browser: 134.1.76.74 Chrome: 134.0.6998.166 Safari: 18.3
Details
I’m trying to upgrade our project from rspack/rscore v1.1.5 to 1.3.0. However, I’m running into this error while doing a “production” bundle. The issue does not exist when running the dev server:
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 best match Location: crates/rspack_plugin_extract_css/src/plugin.rs:252
Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1: _blake3_compress_in_place_portable 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: _napi_register_module_v1 at <unknown source file> 6: _wasmer_vm_f64_nearest at <unknown source file> 7: _wasmer_vm_f64_nearest 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_deallocate at <unknown source file> 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 best match Location: crates/rspack_plugin_extract_css/src/plugin.rs:252
Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1: _blake3_compress_in_place_portable 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: _napi_register_module_v1 at <unknown source file> 6: _wasmer_vm_f64_nearest at <unknown source file> 7: _wasmer_vm_f64_nearest 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_deallocate at <unknown source file> 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 best ma%
I cannot create a reproducible example. It is only happening in our project and I can’t seem to figure out why. It obviously appears to be something with the CSS processors. FWIW, it’s not happening when I run it in DEV mode so I suspect it’s something with the CssExtractRspackPlugin. Based on this stack trace, I don’t even know where to begin debugging where it might be failing in our code.
What’s even more strange is if I manually downgrade on the branch back to v1.1.5, the error continues. If I switch back to the base branch and reinstall, it goes away. There are no other changes aside from the version upgrade.
Reproduce link
No response
Reproduce Steps
our plugin setup is as follows: From @rspack/core
- CssExtractRspackPlugin
- CopyRspackPlugin
- DefinePlugin
- ProgressPlugin
Others: -@rsbuild/plugin-vue
- webpack-plugin-vuetify
And this is what the loader rules are:
{
test: /\.css$/i,
use: [
{
loader: process.env.NODE_ENV === 'production' ? CssExtractRspackPlugin.loader : 'style-loader'
},
'css-loader'
]
},
{
test: /\.sass$/i,
use: [
{
loader: process.env.NODE_ENV === 'production' ? CssExtractRspackPlugin.loader : 'style-loader'
},
'css-loader',
'resolve-url-loader',
{
loader: 'sass-loader',
options: {
api: 'modern-compiler',
sourceMap: true
}
},
{
loader: 'sass-resources-loader',
options: {
resources: require(path.join(process.cwd(), 'src/assets/css/sassUtils.js'))
}
}
]
},
{
test: /\.scss$/i,
use: [
{
loader: process.env.NODE_ENV === 'production' ? CssExtractRspackPlugin.loader : 'style-loader'
},
'css-loader',
'resolve-url-loader',
{
loader: 'sass-loader',
options: {
api: 'modern-compiler',
sourceMap: true
}
},
{
loader: 'sass-resources-loader',
options: {
resources: require(path.join(process.cwd(), 'src/assets/css/scssUtils.js')),
hoistUseStatements: true
}
}
]
}```
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (9 by maintainers)
Disabling the
parallelCodeSplittingindeed fixed the issue. ThesplitChunksoption didn’t make a difference.I found the reason, thanks to #9870, I’ll close this, we can continue discussion there
I think version (1.3.1-canary-93249101-20250401035144) may fix
Could you help verify it ?
I encountered the same issue with version 1.3.0, and I resolved it by disabling parallelCodeSplitting.
Can you help me verify if version 1.3.1-canary-e7b7cad7-20250328135852 fixes this?