You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vp build completes the build successfully but the process never exits when sass-embedded is installed as the Sass compiler. The Dart VM child process spawned by sass-embedded keeps the Node event loop alive indefinitely.
Vite+ CLI behavior:vp build does not call process.exit(0) after a successful build. It relies on the Node event loop draining naturally. When any plugin or preprocessor leaves a handle open (like sass-embedded's persistent ChildProcess), the process hangs forever.
This is the same class of issue as #1396 — the CLI is not resilient against lingering event loop handles from third-party tools.
Reproduction
In any Vite+ project that uses SCSS:
vp install sass-embedded
vp uninstall sass
Run vp build
The build output completes successfully (~19s in our case), but the process hangs at 100% and never exits
lsof -p <pid> shows an orphaned Dart child process keeping the event loop alive
Expected behavior
vp build should exit with code 0 after the build completes, regardless of whether preprocessor plugins have properly cleaned up their handles.
Suggested fix
Short-term (Vite+ side): Add an explicit process.exit(0) in the vp build CLI path after successful build completion. This is a defense-in-depth measure that makes the CLI resilient to handle leaks from any plugin or preprocessor — not just sass-embedded.
Long-term (upstream): Once vitejs/vite#22274 is fixed and the updated Vite source is re-bundled into vite-plus-core, the Dart subprocess will be properly disposed and the event loop will drain naturally. The explicit process.exit(0) would still be good practice as a safety net.
Workaround
Use sass (Dart Sass compiled to JavaScript) instead of sass-embedded. Same API, same output, but runs in-process with no child process — so the event loop drains naturally after build.
Describe the bug
vp buildcompletes the build successfully but the process never exits whensass-embeddedis installed as the Sass compiler. The Dart VM child process spawned bysass-embeddedkeeps the Node event loop alive indefinitely.Root cause (two layers):
Upstream Vite bug ([Bug]: sass-embedded ChildProcess outlives
server.close()- cssPlugin teardown dropsworker.stop()promise vitejs/vite#22274): Vite'sscssProcessor.close()is synchronous but callsasync stop()which awaitscompiler.dispose(). The promise is dropped, so the sass-embedded Dart subprocess is never shut down. Sincevite-plus-corebundles Vite's CSS plugin code, this bug is present in Vite+ as well.Vite+ CLI behavior:
vp builddoes not callprocess.exit(0)after a successful build. It relies on the Node event loop draining naturally. When any plugin or preprocessor leaves a handle open (like sass-embedded's persistent ChildProcess), the process hangs forever.This is the same class of issue as #1396 — the CLI is not resilient against lingering event loop handles from third-party tools.
Reproduction
vp buildlsof -p <pid>shows an orphaned Dart child process keeping the event loop aliveExpected behavior
vp buildshould exit with code 0 after the build completes, regardless of whether preprocessor plugins have properly cleaned up their handles.Suggested fix
Short-term (Vite+ side): Add an explicit
process.exit(0)in thevp buildCLI path after successful build completion. This is a defense-in-depth measure that makes the CLI resilient to handle leaks from any plugin or preprocessor — not just sass-embedded.Long-term (upstream): Once vitejs/vite#22274 is fixed and the updated Vite source is re-bundled into
vite-plus-core, the Dart subprocess will be properly disposed and the event loop will drain naturally. The explicitprocess.exit(0)would still be good practice as a safety net.Workaround
Use
sass(Dart Sass compiled to JavaScript) instead ofsass-embedded. Same API, same output, but runs in-process with no child process — so the event loop drains naturally after build.System Info
Validations
server.close()- cssPlugin teardown dropsworker.stop()promise vitejs/vite#22274), butvp buildnot callingprocess.exit()is specific to Vite+.