Conversation
Deploying rspack-playground with
|
| Latest commit: |
9d6f111
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9bf04347.rspack-playground.pages.dev |
| Branch Preview URL: | https://fix-rebuild-hang.rspack-playground.pages.dev |
8d3f65e to
1255c35
Compare
1255c35 to
9d6f111
Compare
Collaborator
|
close in favor of a8a5d89 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root Cause
Browser instrumentation narrowed the hang to the second compile inside a reused bundler worker. The first request completes, but on rebuild the worker reaches
rspack(options, callback)and the callback never fires, so the main thread keeps waiting and the UI remains onBundling....The trigger is the shared
@rspack/browserbuiltinMemFs.volume.reset()call in the reused worker. In controlled browser runs:volume.reset()reachescore rspack starton request 1 and never logs the callbackcompiler.run()withoutcompiler.close()still hangs whenvolume.reset()is kept, socompiler.close()is not the root causerspack(options, callback)path but skippingvolume.reset()lets request 1 finish normally in the same workerThat points to the global in-worker memfs state used by
@rspack/browser: resetting the shared volume after one compile can wedge the next native build. A fresh worker avoids reusing that corrupted shared runtime/memfs state.Summary
@rspack/browserworker state after memfs resetVerification
http://127.0.0.1:3000/; initial build completed, then 6 rapid real keyboard edits in Monaco briefly showedBundling...and recovered to173mswith output presentvolume.reset(): request 1 reachedcore rspack startand did not callback within 10scompiler.run()no-close andvolume.reset(): request 1 reachedcore compiler.run start no-closeand did not callback within 10srspack(options, callback)and reset skipped: request 1 loggedcore rspack callback okandbundle done 1, UI recovered to78ms