Fix WASM debugger breakpoints not hitting after Terser 5.39+.#123353
Merged
ilonatommy merged 1 commit intodotnet:mainfrom Jan 19, 2026
Merged
Fix WASM debugger breakpoints not hitting after Terser 5.39+.#123353ilonatommy merged 1 commit intodotnet:mainfrom
ilonatommy merged 1 commit intodotnet:mainfrom
Conversation
Contributor
|
Tagging subscribers to this area: @steveisok, @thaystg, @dotnet/dotnet-diag |
pavelsavara
approved these changes
Jan 19, 2026
thaystg
approved these changes
Jan 19, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical bug where WASM debugger breakpoints stopped working after Terser 5.39+ was introduced. Terser 5.39 added an optimization that removes console.assert(true, ...) statements as "unnecessary", which broke the debugger proxy's ability to read variables from paused scopes. The fix replaces the static true value with !!Date.now(), which evaluates to true at runtime but cannot be statically analyzed by Terser.
Changes:
- Updated two
console.assertcalls to use!!Date.now()instead oftrueto prevent Terser optimization - Added clear explanatory comments describing why the change was necessary and how the workaround works
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.
Terser 5.39 introduced an optimization that removes console.assert(true, ...) as "unnecessary" https://github.com/terser/terser/blob/master/CHANGELOG.md#v5390.
In runtime we are counting on the assert to keep
base64String:runtime/src/mono/browser/runtime/debug.ts
Line 37 in 1af7e1a
The assert removal caused the
base64Stringto be optimized away, breaking theBrowserDebugProxy'sability to read debugger agent info from the paused scope.This affects net11 debugging, net10 works correctly.
This PR replaces
truewith!!Date.now()which Terser cannot statically evaluate.