rugufu
September 28, 2023, 8:19am
1
Summary
I’m getting this StopException when debugging in VSCode.
Need help, here are the details…
My .vscode/launch.json
{
"name": "Streamlit: Current File",
"type": "python",
"request": "launch",
"module": "streamlit",
"env": {
// any .env variables you may have
"STREAMLIT_APP": "${file}",
"STREAMLIT_ENV": "development",
},
"args": [
"run",
"${file}"
],
"jinja": true,
"justMyCode": true
}
Steps to Reproduce
Open app.py in VSCode and then Debug Streamlit: Current File
This occurs
Workaround
Running streamlit run app.py will work, but no debugging
Hi @rugufu
This seems to be a recurring issue for VS Code, I’d recommend taking a deep dive into the VS Code GitHub issues or their forum.
To get you started, here are some related posts:
opened 05:24PM - 15 Mar 23 UTC
closed 06:55PM - 27 Mar 23 UTC
*duplicate
Type: <b>Bug</b>
Steps to reproduce:
1. ng serve to start the angular app
2… . run and debug
3. see a blank page with the spinning icon keep loading
Now:
When I debug Angular app in vscode, the debugging chrome instance will be open but the page is blank. If I go to some detailed page, and click back arrow, it will show a few icons for the page for one second then went disappear. This happened since last Friday, previously was good. Looks like only I have this issue, didn't hear other other team members complain about it. I have tried Microsoft Edge too, same issue.
Expected result:
Debug needs to be fixed. If the browser is not attached in vs code debugger, I can view content and debug in browser. But I would love to keep debugging in vs code.
Things I tried:
1. Debugger attach to Edge
2. Delete all chrome extensions (I don't think this is the issue)
3. Reopen, reinstall, restart
VS Code version: Code 1.76.1 (5e805b79fcb6ba4c2d23712967df89a089da575b, 2023-03-08T16:32:00.131Z)
OS version: Windows_NT x64 10.0.19044
Modes:
Sandboxed: No
<details>
<summary>System Info</summary>
|Item|Value|
|---|---|
|CPUs|11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz (16 x 2496)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: disabled_off<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_renderer: enabled_on<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: disabled_off|
|Load (avg)|undefined|
|Memory (System)|31.67GB (17.06GB free)|
|Process Argv|--crash-reporter-id 1abdd797-7727-4aa6-aed7-df3f639a7879|
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (29)</summary>
Extension|Author (truncated)|Version
---|---|---
csharp-to-typescript|adr|1.12.1
ng-template|Ang|15.2.0
gitstash|art|5.1.0
path-intellisense|chr|2.8.4
vscode-eslint|dba|2.4.0
githistory|don|0.6.20
gitlens|eam|13.3.2
EditorConfig|Edi|0.16.4
vscode-typescript-exportallmodules|eli|2.6.0
prettier-vscode|esb|9.10.4
json2ts|Gre|0.0.6
angular-essentials|joh|13.0.0
Angular2|joh|13.0.0
vscode-peacock|joh|4.2.2
ts-debug|kak|0.0.6
ts-extension-pack|loi|0.3.0
ts-error-translator|mat|0.8.0
git-graph|mhu|1.30.0
vscode-edge-devtools|ms-|2.1.1
amend-commit-message|Osi|1.0.0
material-icon-theme|PKi|4.24.0
tsimporter|pmn|2.0.1
typescript-hero|rbb|3.0.0
LiveServer|rit|5.7.9
code-spell-checker|str|2.20.0
move-ts|str|1.12.0
tabnine-vscode|Tab|3.6.43
tcv-typescript-constructor-generator|toa|0.2.0
vscode-todo-highlight|way|1.0.5
</details><details>
<summary>A/B Experiments</summary>
```
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vstes627cf:30244335
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
pynewvextcfv2:30681851
azure-dev_surveyone:30548225
vscccc:30610679
pyindex848:30662994
nodejswelcome1cf:30587006
282f8724:30602487
pyind779:30671433
f6dab269:30613381
pythonsymbol12:30671437
a9j8j154:30646983
showlangstatbar:30672706
vscodedisable:30660115
funwalk2:30682974
pythonms35:30686772
```
</details>
Hope this helps!
That issue has nothing to do with this problem, it seems.
I’ve found that when debugging with VSCode that any navigation away from the page when still processing the python script produces an exception, specifically a StopException.
I’ve tried catching this globally, and maybe I’m just a python noob, but I can’t find the actual type to catch, and so my exception block can’t distinguish between the StopException and something I actually care about, so I can’t tell the VSCode debugger to only break on uncaught exceptions.
1 Like
I observed the same, it would be great to know how to avoid that. It’s becoming increasingly difficult to debug with VS Code. (Same happens also Streamlit 3.15)
system
Closed
November 20, 2024, 8:56pm
5
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.