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

Missing pyodide attributes js.document and js.window #94

Open
qqdaiyu55 opened this issue Apr 25, 2022 · 1 comment
Open

Missing pyodide attributes js.document and js.window #94

qqdaiyu55 opened this issue Apr 25, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@qqdaiyu55
Copy link
Contributor

Description

Current pyodide stays on version v0.20.0, which should support js.window or js.document following the pyodide doc.

However, I cannot use them in jupyterlite.
image

Use pyodide REPL:
image

@qqdaiyu55 qqdaiyu55 added the bug Something isn't working label Apr 25, 2022
@jtpio
Copy link
Member

jtpio commented Apr 25, 2022

Thanks @qqdaiyu55 for opening this.

In JupyterLite the Pyodide-based kernel runs in a Web Worker instead of the main thread. Which means some of the APIs and access to the DOM are not directly supported, although some projects like Comlink could help with this.

In theory it's possible to implement a custom JupyterLite kernel that would run Pyodide in the main thread and would give access to document and window, However this is likely not going to be supported by default in core JupyterLite.

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