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

Jupyter interactive mode broken in 1.91.0 and subsequent VSCode versions #227745

Closed
colehaus opened this issue Sep 6, 2024 · 10 comments
Closed
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) info-needed Issue requires more information from poster

Comments

@colehaus
Copy link

colehaus commented Sep 6, 2024

Type: Bug

Jupyter interactive mode was working fine 1.90.* but it seems to be broken for me in all subsequent versions. New interactive windows generally spawn with the following error:

The editor could not be opened due to an unexpected error: Could not initialize webview: Error: Could not register service worker: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state..}

If I hit Try Again, the basic UI shell loads. But now trying to use the REPL results in a "Cannot read properties of undefined (reading 'size')" message for any input at all.

When I set the log level to debug, this is what I see in the log:

2024-09-05 21:37:54.393 [debug] [ExtHostInteractive] open iw with notebook editor id undefined
2024-09-05 21:37:54.393 [debug] [ExtHostInteractive] notebook editor not found, uris for the interactive document {"$mid":1,"external":"untitled:/Interactive-1.interactive","path":"/Interactive-1.interactive","scheme":"untitled"} {"$mid":1,"external":"vscode-interactive-input:/InteractiveInput-1","path":"/InteractiveInput-1","scheme":"vscode-interactive-input"}
2024-09-05 21:37:54.394 [error] Error: Failed to request creation of interactive window from VS Code.
    at oI.createEditor (/home/.../.vscode/extensions/ms-toolsai.jupyter-2024.5.2024052901-linux-x64/dist/extension.node.js:367:4426)
    at oI.create (/home/.../.vscode/extensions/ms-toolsai.jupyter-2024.5.2024052901-linux-x64/dist/extension.node.js:367:3398)
    at oI.getOrCreate (/home/.../.vscode/extensions/ms-toolsai.jupyter-2024.5.2024052901-linux-x64/dist/extension.node.js:367:2508)
    at Ko.createNewInteractiveWindow (/home/.../.vscode/extensions/ms-toolsai.jupyter-2024.5.2024052901-linux-x64/dist/extension.node.js:341:13915)
    at f.h (/nix/store/p4miq91phxp1bjhhrmbrqn8l04v5dkxg-vscode-1.91.0/lib/vscode/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:154:204392) jupyter.createnewinteractive {"value":"ms-toolsai.jupyter","_lower":"ms-toolsai.jupyter"}
2

It seems like it might be related to this issue: #197246

(This seems like an issue with VSCode rather than the extension but let me know if I should move it.)

VS Code version: Code 1.91.0 (ea1445c, 2024-07-01T18:52:41.959Z)
OS version: Linux x64 6.6.37
Modes:

System Info
Item Value
CPUs 13th Gen Intel(R) Core(TM) i7-13700H (20 x 4131)
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_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 2, 2, 2
Memory (System) 31.04GB (11.85GB free)
Process Argv --log debug --log ms-toolsai.jupyter:debug --crash-reporter-id 9f882ebd-89b0-426c-87df-94a2b3e47766
Screen Reader no
VM 0%
DESKTOP_SESSION plasma
XDG_CURRENT_DESKTOP KDE
XDG_SESSION_DESKTOP plasma
XDG_SESSION_TYPE wayland
Extensions (41)
Extension Author (truncated) Version
markdown-mermaid bie 1.24.0
mermaid-markdown-syntax-highlighting bpr 1.6.6
ruff cha 2024.42.0
vscode-markdownlint Dav 0.55.0
dendron-markdown-shortcuts den 0.12.1
macros ged 1.2.1
html-preview-vscode geo 0.2.5
copilot Git 1.229.0
copilot-chat Git 0.18.2
remotehub Git 0.64.0
haskell has 2.4.4
nix-ide jno 0.3.3
language-haskell jus 3.6.0
git-graph mhu 1.30.0
direnv mkh 0.17.0
vscode-docker ms- 1.29.2
debugpy ms- 2024.10.0
python ms- 2024.14.0
vscode-pylance ms- 2024.8.104
jupyter ms- 2024.5.2024052901
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.0.19
tensorboard ms- 2023.10.1002992421
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
remote-ssh ms- 0.113.1
remote-ssh-edit ms- 0.86.0
azure-repos ms- 0.40.0
remote-explorer ms- 0.4.3
remote-repositories ms- 0.42.0
wordcount ms- 0.1.0
vscode-paste-image mus 1.0.4
pandocciter not 0.10.4
bib phr 0.3.0
vscode-yaml red 1.15.0
semanticdiff sem 0.9.0
markdown-preview-enhanced shd 0.8.13
even-better-toml tam 0.19.2
graphviz-interactive-preview tin 0.3.5
pdf tom 1.2.2
vim vsc 1.28.0

(1 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
a9j8j154:30646983
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
0ee40948:31013168
a69g1124:31058053
dvdeprecation:31068756
dwnewjupyter:31046869
2f103344:31071589
impr_priority:31102340
refactort:31108082
pythonrstrctxt:31112756
wkspc-onlycs-t:31132770
wkspc-ranged-t:31125599
ei213698:31121563

Copy link

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.93.0. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@amunger
Copy link
Contributor

amunger commented Sep 6, 2024

How are you creating the interactive window? Does it work with Jupyter: Create Interactive Window?

Does this happen after closing all windows and reloading vscode, or are you starting up with a previous IW restored?

@amunger amunger added the info-needed Issue requires more information from poster label Sep 6, 2024
@colehaus
Copy link
Author

colehaus commented Sep 6, 2024

It happens when I try to do Jupyter: Create Interactive Window, when I do jupyter.execSelectionInteractive, when I close all windows and restart, when reloading, with restored or new IWs, etc. Interactive mode seems to be broken in basically the same way for all of these entry paths.

@amunger
Copy link
Contributor

amunger commented Sep 9, 2024

can you open the developer tools (Toggle developer tools) and check for any errors in the console when creating an IW fails

@colehaus
Copy link
Author

colehaus commented Sep 9, 2024

Same info, just in different formats:

[Extension Host] info 14:46:24.831: Jupyter Extension: Starting interactive window for resource '' with controller '97dfcd0b8d821664a23b3a32eb77d7a447c7c4f93d10bc853d49d6e11f78f643..python3./python./.-m#ipykernel_launcher (Interactive)'
event.ts:42 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
webviewElement.ts:486 An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.
console.ts:137 [Extension Host] info 14:46:24.872: Jupyter Extension: Attempting to start a server because of preload conditions ...
index.html?id=1f057f…otebookRenderer:303 Uncaught (in promise) Error: Could not register service worker: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state..
    at index.html?id=1f057f…bookRenderer:303:20
index.html?id=1f057f…otebookRenderer:955 Webview fatal error: Error: Could not register service worker: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state..
notificationsAlerts.ts:42 Error loading webview: Error: Could not register service worker: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state..
log.ts:439   ERR Error: Could not initialize webview: Error: Could not register service worker: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state..}
    at d.value (backLayerWebView.ts:590:28)
    at l.B (event.ts:1211:13)
    at l.fire (event.ts:1242:9)
    at webviewElement.ts:232:23
    at webviewElement.ts:514:35
    at Set.forEach (<anonymous>)
    at H.onmessage (webviewElement.ts:514:16)

image

@amunger
Copy link
Contributor

amunger commented Sep 9, 2024

One thing to try is to clear the notebook editor type cache: Developer: Clear Notebook Editor Type Cache and reload the window.

Also, are you able to create a normal notebook editor: Create: New Jupyter Notebook

@colehaus
Copy link
Author

colehaus commented Sep 9, 2024

New Jupyter Notebook results in seemingly identical misbehavior and Developer: Clear Notebook Editor Type Cache doesn't seem to change anything.

@amunger
Copy link
Contributor

amunger commented Sep 9, 2024

can you try in a fresh profile to make sure it's not some other extension breaking things - Profiles: Create a Temporary Profile, and try creating a notebook there (jupyter ext not required)

@colehaus
Copy link
Author

colehaus commented Sep 9, 2024

Same thing
image

@mjbvz
Copy link
Collaborator

mjbvz commented Sep 10, 2024

Duplicate of #125993

Please try fully closing and killing all VS Code processes and then reloading from a fresh start

@mjbvz mjbvz closed this as completed Sep 10, 2024
@mjbvz mjbvz added the *duplicate Issue identified as a duplicate of another issue(s) label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
*duplicate Issue identified as a duplicate of another issue(s) info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants