Skip to content

Breakpoints not resolving when debugging Web Extension #232544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
richard-fine opened this issue Oct 30, 2024 · 6 comments · Fixed by microsoft/vscode-js-debug#2147
Closed

Breakpoints not resolving when debugging Web Extension #232544

richard-fine opened this issue Oct 30, 2024 · 6 comments · Fixed by microsoft/vscode-js-debug#2147
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Milestone

Comments

@richard-fine
Copy link

Type: Bug

  1. Create a new Web Extension using yo code (using webpack + npm)
  2. Open the extension in VS Code
  3. Open src/web/extension.ts and set a breakpoint in the activate function
  4. Go to the 'Run & Debug' tab and launch the 'Run Web Extension' configuration
  5. In the Extension Host, open the command palette and run the 'Hello World' command to activate the extension.
  6. Observe that the 'Congratulations, your extension is active' message is logged to the debug console and the 'Hello World' message is shown as a popup, indicating that the extension was activated

Expected behaviour: The breakpoint should have been resolved / hit when the extension was activated.

Actual behaviour: The extension was activated and ran without ever hitting the breakpoint.

VS Code version: Code 1.95.0 (912bb68, 2024-10-28T20:16:24.561Z)
OS version: Windows_NT x64 10.0.22631
Modes:

System Info
Item Value
CPUs AMD Ryzen Threadripper PRO 3995WX 64-Cores (64 x 2695)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 127.84GB (74.22GB free)
Process Argv --disable-extensions --crash-reporter-id 9f32c0d5-db48-49e8-81cf-9346e360040d
Screen Reader no
VM 0%
Extensions disabled
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
vscaat:30438848
c4g48928:30535728
azure-dev_surveyonecf:30548226
962ge761:30959799
pythongtdpath:30769146
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
724cj586:31013169
dvdeprecation:31068756
dwnewjupytercf:31046870
newcmakeconfigv2:31071590
impr_priority:31102340
nativerepl2:31139839
refactort:31108082
pythonrstrctxt:31112756
wkspc-onlycs-t:31132770
wkspc-ranged-t:31151552
cf971741:31144450
iacca1:31156133
notype1:31157159
5fd0e150:31155592

@OlivierPoitras
Copy link

@richard-fine I'm pretty sure it's a duplicate of 232651. Try this:

  1. Disable the VSCode extension "JavaScript Debugger" (ms-vscode.js-debug)
  2. Install and enable the VSCode extension "JavaScript Debugger (Nightly)" (ms-vscode.js-debug-nightly)
  3. Place a breakpoint
  4. Run the code

If your issue is fixed, then it is likely a duplicate. It will be fixed on VSCode version 1.95.2

@richard-fine
Copy link
Author

No luck - tried with ms-vscode.js-debug-nightly version v2024.11.417 but the issue persists.

@richard-fine
Copy link
Author

A bit more investigation:

  • The debugger keyword in my extension code also does not cause the debugger to halt.
  • I do not see any paths that look like my extension in the 'Loaded Scripts' panel.
  • The extension is definitely being activated, I have a console.log message in my activate function and I see the log message as expected.

@richard-fine
Copy link
Author

I've also tried setting "trace": true in my launch.json to generate verbose logs, and this produces a .gz file which is ~168KB in size, but it seems to be invalid (cannot be decompressed with gunzip, is not accepted by vscode-js-debug log analyzer).

@roblourens roblourens assigned connor4312 and unassigned roblourens Nov 6, 2024
@minestarks
Copy link
Member

minestarks commented Dec 2, 2024

I think this may be the same issue: microsoft/vscode-js-debug#2135

And this as well: #231015

@connor4312
Copy link
Member

Verified on the duplicate js-debug issue

@connor4312 connor4312 added the verified Verification succeeded label Jan 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants