Skip to content
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

JavaScript Debugger with launched chromium halts on every loaded file #178556

Closed
bmakan opened this issue Mar 29, 2023 · 2 comments
Closed

JavaScript Debugger with launched chromium halts on every loaded file #178556

bmakan opened this issue Mar 29, 2023 · 2 comments
Assignees
Labels
*as-designed Described behavior is as designed

Comments

@bmakan
Copy link

bmakan commented Mar 29, 2023

Type: Performance Issue

I've recently started using ViteJS instead of webpack. In dev mode, instead of bundling everything up, it serves every file separately and transpiles it on the fly.

But when I set a breakpoint in vscode, refresh the page, the browser (Edge launched via debugger) stops briefly after every file is loaded and then continues to the next file. Considering they aren't bundled, there can be hundreds of files included in the app and the entire process of loading the app lasts over a minute. Then the page refreshes for some reason and the process starts all over. The page is usually never loaded and the breakpoint never hit.

When I open the exact same app via Edge not launched via debugger, this doesn't happen - the page loads up correctly and the breakpoint is hit. This leads me to believe it's an issue in between vscode's debugger and Edge.

The exact same thing happens with Google Chrome. Firefox doesn't have this issue (used the Firefox Debugger Extension).

Here's the launch.json config:

{
            "name": "Launch Egde",
            "type": "msedge",
            "outFiles": [
                "${workspaceFolder}/public/",
            ],
            "request": "launch",
            "sourceMaps": true,
            "url": "https://localhost:44300/vite-dev",
            "webRoot": "${workspaceFolder}/src/client/",
            "pathMapping": {
                "url": "webpack://athenaeum",
                "path": "${workspaceFolder}/src/client"
            }
        },

VS Code version: Code 1.76.2 (ee2b180, 2023-03-14T17:55:54.936Z)
OS version: Windows_NT x64 10.0.19044
Modes:
Sandboxed: No
Remote OS version: Linux x64 5.4.0-131-generic

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i5-1145G7 @ 2.60GHz (8 x 1498)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 15.40GB (2.68GB free)
Process Argv --crash-reporter-id 0e2907cf-6f55-46cf-9c6a-ef4845ad0d17
Screen Reader no
VM 0%
Item Value
Remote SSH: my-remote-server
OS Linux x64 5.4.0-131-generic
CPUs Intel(R) Xeon(R) CPU E3-1230 V2 @ 3.30GHz (8 x 1600)
Memory (System) 15.61GB (2.25GB free)
VM 0%
Process Info
CPU %	Mem MB	   PID	Process
    0	   139	 19608	code main
    0	    93	 12756	   issue-reporter
    0	   262	 14664	   gpu-process
    0	   137	 16816	   shared-process
    0	    80	  9252	     fileWatcher
    0	    74	 25244	     ptyHost
    0	     7	  2836	       console-window-host (Windows internal process)
    0	     5	 24872	       C:\WINDOWS\System32\cmd.exe /c (type "C:\Users\bmakan\AppData\Local\Temp\vscode-linux-multi-line-command-my-remote-server-82206521.sh" | "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 56497 "my-remote-server" bash) & exit /b 0
    0	    10	 27200	         "C:\Windows\System32\OpenSSH\ssh.exe"  -T -D 56497 "my-remote-server" bash
    0	     7	 27508	       console-window-host (Windows internal process)
    0	     5	 30008	       C:\WINDOWS\System32\cmd.exe /c (type "C:\Users\bmakan\AppData\Local\Temp\vscode-linux-multi-line-command-my-remote-server-45218716.sh" | "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 54440 "my-remote-server" bash) & exit /b 0
    0	     9	 18620	         "C:\Windows\System32\OpenSSH\ssh.exe"  -T -D 54440 "my-remote-server" bash
    0	    27	 17152	   crashpad-handler
    0	   345	 19072	   window (selectors.ts - athenaeum [SSH: my-remote-server] - Visual Studio Code)
    0	    42	 22484	   utility-network-service
    0	    74	 24452	   utility-process
    0	   113	 30264	   utility-process
    0	   178	 19612	     electron-nodejs (ms-vscode.js )
    0	    64	  1300	       window (undefined)
    0	   168	  6924	       window (undefined)
    0	    28	  8480	       utility-process
    0	    78	 17244	       window (undefined)
    0	    21	 17588	       utility-process
    0	    27	 17680	       utility-process
    0	   146	 19852	       window (undefined)
    0	    54	 21012	       window (undefined)
    0	    40	 23748	       utility-network-service
    0	    35	 24180	       window (undefined)
    0	    91	 24920	       window (undefined)
    0	    58	 26308	       window (undefined)
    0	    10	 26336	       crashpad-handler
    0	   229	 27204	       gpu-process
    0	  1009	 30692	       window (undefined)

Remote: SSH: my-remote-server
CPU %	Mem MB	   PID	Process
    0	     0	1464796	remote agent
    0	     0	1464856	   ptyHost
    0	     0	1465127	     /bin/bash --init-file /home/bmakan/.vscode-server/bin/ee2b180d582a7f601fa6ecfdad8d9fd269ab1884/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh
    0	     0	1485727	       npm run dev
    0	     0	1485748	         sh -c vite
    0	     0	1485749	           node /home/bmakan/ws/athenaeum/src/client/node_modules/.bin/vite
    0	     0	1485760	             /home/bmakan/ws/athenaeum/src/client/node_modules/@esbuild/linux-x64/bin/esbuild --service=0.16.17 --ping
    0	     0	1466069	     /bin/bash --init-file /home/bmakan/.vscode-server/bin/ee2b180d582a7f601fa6ecfdad8d9fd269ab1884/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh
    0	     0	1466451	       node ./node_modules/typescript/bin/tsc --noEmit --watch
    0	     0	1484588	     /bin/bash
    0	     0	1484747	       /home/bmakan/python-venvs/athenaeum/bin/python /home/bmakan/.vscode-server/extensions/ms-python.python-2023.4.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher 33081 -- -m flask run --no-debugger --reload --port 5000
    0	     0	1484757	         /home/bmakan/python-venvs/athenaeum/bin/python -X frozen_modules=off /home/bmakan/.vscode-server/extensions/ms-python.python-2023.4.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy --connect 127.0.0.1:39013 --configure-qt none --adapter-access-token d659e484f38d40b6f0c50c7bc4fbc41b29178513755c6fc5296eac6211c46821 -m flask run --no-debugger --reload --port 5000
    0	     0	1484824	           /home/bmakan/python-venvs/athenaeum/bin/python /home/bmakan/.vscode-server/extensions/ms-python.python-2023.4.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd.py --module --port 39013 --ppid 1484757 --client 127.0.0.1 --client-access-token d659e484f38d40b6f0c50c7bc4fbc41b29178513755c6fc5296eac6211c46821 --debug-mode debugpy-dap --preimport /home/bmakan/.vscode-server/extensions/ms-python.python-2023.4.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/..;debugpy._vendored.force_pydevd --multiprocess --skip-notify-stdin --json-dap-http --file flask run --no-debugger --reload --port 5000
    0	     0	1465071	   extension-host
    0	     0	1465290	     /home/bmakan/.vscode-server/bin/ee2b180d582a7f601fa6ecfdad8d9fd269ab1884/node --max-old-space-size=3072 /home/bmakan/ws/athenaeum/src/client/node_modules/typescript/lib/tsserver.js --serverMode partialSemantic --useInferredProjectPerProjectRoot --disableAutomaticTypingAcquisition --cancellationPipeName /tmp/vscode-typescript69057057/51bdf778b27b96f6b474/tscancellation-7f9cf7f1b8e80fe3f3ea.tmp* --globalPlugins @vsintellicode/typescript-intellicode-plugin,ms-vsintellicode-typescript --pluginProbeLocations /home/bmakan/.vscode-server/extensions/visualstudioexptteam.vscodeintellicode-1.2.30,/home/bmakan/.vscode-server/extensions/visualstudioexptteam.vscodeintellicode-1.2.30 --locale en --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc
    0	     0	1465296	     /home/bmakan/.vscode-server/bin/ee2b180d582a7f601fa6ecfdad8d9fd269ab1884/node --max-old-space-size=3072 /home/bmakan/ws/athenaeum/src/client/node_modules/typescript/lib/tsserver.js --useInferredProjectPerProjectRoot --enableTelemetry --cancellationPipeName /tmp/vscode-typescript69057057/51bdf778b27b96f6b474/tscancellation-5d9924f71889794094a7.tmp* --globalPlugins @vsintellicode/typescript-intellicode-plugin,ms-vsintellicode-typescript --pluginProbeLocations /home/bmakan/.vscode-server/extensions/visualstudioexptteam.vscodeintellicode-1.2.30,/home/bmakan/.vscode-server/extensions/visualstudioexptteam.vscodeintellicode-1.2.30 --locale en --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc
    0	     0	1465331	       /home/bmakan/.vscode-server/bin/ee2b180d582a7f601fa6ecfdad8d9fd269ab1884/node /home/bmakan/ws/athenaeum/src/client/node_modules/typescript/lib/typingsInstaller.js --globalTypingsCacheLocation /home/bmakan/.cache/typescript/5.0 --enableTelemetry --typesMapLocation /home/bmakan/ws/athenaeum/src/client/node_modules/typescript/lib/typesMap.json --validateDefaultNpmLocation
    0	     0	1465304	     /home/bmakan/.vscode-server/bin/ee2b180d582a7f601fa6ecfdad8d9fd269ab1884/node /home/bmakan/.vscode-server/extensions/visualstudioexptteam.intellicode-api-usage-examples-0.2.7/dist/server/server.js --node-ipc --clientProcessId=1465071
    0	     0	1465372	     /home/bmakan/python-venvs/athenaeum/bin/python /home/bmakan/.vscode-server/extensions/ms-python.flake8-2023.4.0/bundled/tool/lsp_server.py
    0	     0	1465391	     /home/bmakan/.vscode-server/bin/ee2b180d582a7f601fa6ecfdad8d9fd269ab1884/node /home/bmakan/.vscode-server/extensions/dbaeumer.vscode-eslint-2.4.0/server/out/eslintServer.js --node-ipc --clientProcessId=1465071
    0	     0	1465435	     /home/bmakan/.vscode-server/bin/ee2b180d582a7f601fa6ecfdad8d9fd269ab1884/node /home/bmakan/.vscode-server/extensions/ms-python.vscode-pylance-2023.3.30/dist/server.bundle.js --cancellationReceive=file:42477f60fa369c778d3d8d2ae431e56ab13dc2d687 --node-ipc --clientProcessId=1465071
    0	     0	1466499	     /home/bmakan/.vscode-server/bin/ee2b180d582a7f601fa6ecfdad8d9fd269ab1884/node /home/bmakan/.vscode-server/bin/ee2b180d582a7f601fa6ecfdad8d9fd269ab1884/extensions/json-language-features/server/dist/node/jsonServerMain --node-ipc --clientProcessId=1465071
    0	     0	1484580	     /home/bmakan/python-venvs/athenaeum/bin/python /home/bmakan/.vscode-server/extensions/ms-python.python-2023.4.1/pythonFiles/lib/python/debugpy/adapter
    0	     0	1465082	   fileWatcher
    0	     0	1490055	   /bin/sh -c /usr/bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
    0	     0	1490056	     /usr/bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
Workspace Info

|  Remote: SSH: my-remote-server|    Folder (athenaeum): 927 files|      File types: tsx(214) pyc(146) ts(140) py(98) js(65) map(50) json(13)
|                  html(7) jsx(5) sh(4)
|      Conf files: dockerfile(2) launch.json(1) settings.json(1)
|                  package.json(1) tsconfig.json(1)
|      Launch Configs: python(2) msedge;
Extensions (28)
Extension Author (truncated) Version
dotenv mik 1.0.1
jupyter-keymap ms- 1.1.0
remote-containers ms- 0.282.0
remote-ssh ms- 0.98.0
remote-ssh-edit ms- 0.84.0
remote-wsl ms- 0.76.1
vscode-remote-extensionpack ms- 0.24.0
remote-explorer ms- 0.2.0
remote-server ms- 1.0.0
vscode-icons vsc 12.2.0
vscode-sql-formatter adp 1.4.4
vscode-nginx-conf ahm 0.1.3
vscode-eslint dba 2.4.0
gitlens eam 13.4.0
html-preview-vscode geo 0.2.5
vscode-docker ms- 1.24.0
flake8 ms- 2023.4.0
isort ms- 2022.8.0
python ms- 2023.4.1
vscode-pylance ms- 2023.3.30
jupyter ms- 2023.2.1200692131
jupyter-keymap ms- 1.1.0
jupyter-renderers ms- 1.0.15
vscode-jupyter-cell-tags ms- 0.1.8
vscode-jupyter-slideshow ms- 0.1.5
vscode-xml red 0.24.0
intellicode-api-usage-examples Vis 0.2.7
vscodeintellicode Vis 1.2.30
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30445986
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
nodejswelcome1:30587005
282f8724:30602487
pyind779:30671433
f6dab269:30613381
pythonsymbol12:30671437
a9j8j154:30646983
vsccsb:30677849
vscodeenable:30660116
azdwalk:30687957
pythonms35:30686772

@bmakan
Copy link
Author

bmakan commented Mar 29, 2023

If I set the breakpoint in browser, not in the vscode, it works as expected. So, this issue seems to happen only when I set the breakpoint in vscode's editor.

@connor4312
Copy link
Member

connor4312 commented Mar 29, 2023

This is by design, we use instrumentation pauses to set scripts in sourcemaps prior to evaluation. Unfortunately it's not possible for us to avoid showing the overlay message when the browser devtools are open, since this is registered and controlled by them.

If we do microsoft/vscode-js-debug#1214, it may be possible to configure the debugger precisely enough that script URIs can be known ahead of time and avoid the instrumentation pause in some cases, but an on-the-fly "dev server" kind of scenario isn't one of those since we don't know about the sourcemaps ahead of time.

@connor4312 connor4312 added the *as-designed Described behavior is as designed label Mar 29, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed
Projects
None yet
Development

No branches or pull requests

3 participants