Closed hikiko4ern closed 3 weeks ago
@hikiko4ern pr welcome
After upgrading sass-loader to 16.0.3 I still experience the issue where the rspack build process does not exit, something is still holding it up.
Maybe rspack doesn't support https://github.com/webpack-contrib/sass-loader/blob/master/src/utils.js#L768
Yes, I am experiencing the same issue - after successful build the process never exits. If I change to api: "modern"
all is good
Bug report
When using the
sass-embedded
with themodern-compiler
API,sass-loader
may create multiple compilers (= make multipleinitAsyncCompiler
calls). Before the created compiler is saved tosassModernCompilers
, there is a check to handle race conditions: https://github.com/webpack-contrib/sass-loader/blob/c75c6061266a6df6a7c736de407fcbf05ef5b2be/src/utils.js#L764-L766But in the case when
sassModernCompilers.has(webpackCompiler) === true
, the newly createdcompiler
is not disposed (i.e.compiler.dispose()
is not called), causingsass-embedded
to never shut down thedart sass.snapshot --embedded
process it started, causing the Node.js process to never exit due to alivechild_process
es.Actual Behavior
Node.js process does not exit due to alive child processes
Expected Behavior
If
sassModernCompilers
already has a compiler, shouldcompiler.dispose()
be called for the newly created compiler? Something likeHow Do We Reproduce?
Unfortunately, even on our closed project with a large number of files, the bug does not reproduce consistently. But it can be easily reproduced by adding a small delay: https://github.com/hikiko4ern/sass-loader-compiler/blob/master/patches/sass-loader.patch
pnpm i
pnpm webpack
It should hang after
Please paste the results of
npx webpack-cli info
here, and mention other relevant information