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

Can not access js.window / js.document #1337

Open
theOvercloud opened this issue Mar 4, 2024 · 1 comment
Open

Can not access js.window / js.document #1337

theOvercloud opened this issue Mar 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@theOvercloud
Copy link

theOvercloud commented Mar 4, 2024

Description

Good morning! First time reporting here. I have an issue, where i can not access the js.document or js.window object from the pydiode js module. I always get an AttributeError. I assume that this is just a configuration issue? Might this be a limitation of service workers?

image

Reproduce

  1. Go to https://jupyterlite.github.io/demo/lab/index.html
  2. Import the js module in a new pydiode notebook
  3. Try to execute js.window or js.document

Note: I have the exact same behavior in my local deployment. I tried it in Chrome and Firefox.

Expected behavior

I would assume that i can access the document or window object.

Context

  • JupyterLite version: latest (0.2.3)
  • Browser and version: Chrome 122, Firefox 123
Browser Output
No satisfying version (^4.0.12) of shared module @jupyterlab/docregistry found in shared scope default.
Available versions: 4.0.11 from _JUPYTERLAB.CORE_OUTPUT remoteEntry.0dca0b46350f0c25c608.js:1:5807
Unsatisfied version 4.0.11 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @jupyterlab/rendermime (required ^4.0.12) remoteEntry.0dca0b46350f0c25c608.js:1:5807
Unsatisfied version 6.0.11 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @jupyterlab/coreutils (required ^6.0.12) remoteEntry.0dca0b46350f0c25c608.js:1:5807
Unsatisfied version 4.0.11 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @jupyterlab/application (required ^4.0.12) remoteEntry.0dca0b46350f0c25c608.js:1:5807
Unsatisfied version 4.0.11 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @jupyterlab/ui-components (required ^4.0.12) remoteEntry.0dca0b46350f0c25c608.js:1:5807
Unsatisfied version 4.1.11 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @jupyterlab/apputils (required ^4.1.12) remoteEntry.0dca0b46350f0c25c608.js:1:5807
Unsatisfied version 4.0.11 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @jupyterlab/translation (required ^4.0.12) remoteEntry.0dca0b46350f0c25c608.js:1:5807
Unsatisfied version 4.0.11 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @jupyterlab/notebook (required ^4.0.12) remoteEntry.0dca0b46350f0c25c608.js:1:5807
Unsatisfied version 4.0.11 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @jupyterlab/notebook (required ^4.1.0) remoteEntry.9f387e5e108e458f62c3.js:1:7192
Unsatisfied version 4.0.11 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @jupyterlab/logconsole (required ^4.1.0) remoteEntry.9f387e5e108e458f62c3.js:1:7192
No satisfying version (^4.1.0) of shared module @jupyterlab/outputarea found in shared scope default.
Available versions: 4.0.11 from _JUPYTERLAB.CORE_OUTPUT remoteEntry.9f387e5e108e458f62c3.js:1:7192
Unsatisfied version 4.0.11 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @jupyterlab/translation (required ^4.1.0) remoteEntry.9f387e5e108e458f62c3.js:1:7192
Unsatisfied version 4.0.11 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @jupyterlab/rendermime (required ^4.1.0) remoteEntry.9f387e5e108e458f62c3.js:1:7192
Unsatisfied version 7.0.11 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @jupyterlab/services (required ^7.1.0) remoteEntry.9f387e5e108e458f62c3.js:1:7192
Unsatisfied version 4.0.11 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @jupyterlab/settingregistry (required ^4.1.0) remoteEntry.9f387e5e108e458f62c3.js:1:7192
Unsatisfied version 4.0.11 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @jupyterlab/mainmenu (required ^4.1.0) remoteEntry.9f387e5e108e458f62c3.js:1:7192
Unsatisfied version 0.2.3 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @jupyterlite/kernel (required ~0.1.0-beta.18) remoteEntry.9117113815033289c4d5.js:1:5416
Unsatisfied version 6.0.11 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @jupyterlab/coreutils (required ^5.5.2) remoteEntry.9117113815033289c4d5.js:1:5416
Unsatisfied version 2.1.2 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @lumino/coreutils (required ^1.11.0) remoteEntry.9117113815033289c4d5.js:1:5416
Unsatisfied version 6.0.11 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @jupyterlab/coreutils (required ^6.0.12) consumes:73:61
Unsatisfied version 2.1.2 of shared singleton module @lumino/signaling (required ^1.4.3) remoteEntry.f69e84c5aaec83c179ca.js:1:5108
Unsatisfied version 2.1.2 of shared singleton module @lumino/coreutils (required ^1.5.3) remoteEntry.f69e84c5aaec83c179ca.js:1:5108
Unsatisfied version 2.1.2 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @lumino/coreutils (required ^1.11.0) remoteEntry.960d5d0f875a651e597f.js:1:5108
Unsatisfied version 2.1.2 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @lumino/signaling (required ^1.10.0) remoteEntry.960d5d0f875a651e597f.js:1:5108
Unsatisfied version 2.0.1 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @lumino/messaging (required ^1.4.3) remoteEntry.2916befd91bdb8847e88.js:1:6038
Unsatisfied version 2.3.1 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @lumino/widgets (required ^1.19.0) remoteEntry.2916befd91bdb8847e88.js:1:6038
Unsatisfied version 1.9.4 from jupyter-leaflet of shared singleton module leaflet (required =1.4.0) remoteEntry.5e71a5e8dcb6330c0085.js:1:7918
Unsatisfied version 4.1.11 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @jupyterlab/apputils (required ^3.5.1) remoteEntry.6a37df5d4590b29196a3.js:1:4825
Unsatisfied version 2.3.1 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @lumino/widgets (required ^1.37.2) remoteEntry.c764a537ae4fed4fb4ca.js:1:5956
JupyterLite ServiceWorker was already registered service-manager.js:40:20
Kernel filesystem and JupyterLite contents will be synced index.js:171:24
Request for font "DejaVu Sans Mono" blocked at visibility level 2 (requires 3)
index.es6.js:4766:12
GET
https://jupyterlite.github.io/demo/extensions/@jupyterlite/pyodide-kernel-extension/static/128.fd6a7bd994d997285906.js?v=fd6a7bd994d997285906
[HTTP/1.1 200  0ms]

GET
https://jupyterlite.github.io/demo/extensions/@jupyterlite/pyodide-kernel-extension/static/600.0dd7986d3894bd09e26d.js?v=0dd7986d3894bd09e26d
[HTTP/1.1 200 0ms]

Pyodide contents will be synced with Jupyter Contents index.js:51:28
Starting WebSocket: wss://jupyterlite.github.io/demo/api/kernels/bc46d209-9e04-4c55-9534-81b16db26ce3 3 default.js:70:20
GET
https://jupyterlite.github.io/demo/extensions/@jupyterlite/pyodide-kernel-extension/static/576.ee3d77f00b3c07797681.js?v=ee3d77f00b3c07797681
[HTTP/1.1 200 0ms]

GET
https://jupyterlite.github.io/demo/extensions/@jupyterlite/pyodide-kernel-extension/static/128.fd6a7bd994d997285906.js?v=fd6a7bd994d997285906
[HTTP/1.1 200 0ms]

GET
https://cdn.jsdelivr.net/pyodide/v0.25.0/full/pyodide.js
[HTTP/1.1 200 0ms]

GET
https://cdn.jsdelivr.net/pyodide/v0.25.0/full/pyodide.asm.js
[HTTP/1.1 200 0ms]

Loading micropip, packaging pyodide.asm.js:9:94945
Loaded micropip, packaging pyodide.asm.js:9:95241
Loading ssl, openssl pyodide.asm.js:9:94945
Failed to fetch ipywidgets through the "jupyter.widget.control" comm channel, fallback to fetching individual model state. Reason: Control comm did not respond in time 336.0a90bd910629a565bb7e.js:1:5782
Loaded openssl, ssl pyodide.asm.js:9:95241
Loading sqlite3 pyodide.asm.js:9:94945
Loaded sqlite3 pyodide.asm.js:9:95241
Loading jedi, parso, decorator, Pygments, six pyodide.asm.js:9:94945
Loaded Pygments, decorator, jedi, parso, six pyodide.asm.js:9:95241
GET
https://jupyterlite.github.io/demo/build/2552.6c5224e.js
[HTTP/1.1 200 0ms]

@theOvercloud theOvercloud added the bug Something isn't working label Mar 4, 2024
@jtpio
Copy link
Member

jtpio commented Mar 4, 2024

Thanks @theOvercloud.

This sounds similar to the issue on the pyodide kernel repo: jupyterlite/pyodide-kernel#94

Typically this is because the Pyodide kernel runs in a Web Worker.

Maybe this could be documented as part of #199.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants