question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BadZipFile Error when launching pyodide kernel via JuptyerLiteServer

See original GitHub issue

Description

This issue is encountered when using the JuptyerLiteServer class within thebe.

The JupyterLiteServer appears to start successfully and begins initializing the kernel, but then an error occurs part way through initialization. This does not appear to be related to the wheels provided by JupyterLite, which appear to be loaded correctly – instead it appears to be an issue with package loading inside the pyodide kernel? is this potentially a configuration issue when using the server within thebe?

The javascript console shows:

image

The network tab shows:

image

The only 404 in the network list is related to the service worker. This has not been configured as it was assumed this was optional and needed only to enable the jupyterlite file system extension?

Reproduce

The issue is encountered in the development branch of thebe here: https://github.com/executablebooks/thebe/pull/569 It could be reproduced locally by:

  1. checkout the branch
  2. install 16, npm 8, turborepo
  3. cd thebe
  4. npm install
  5. npm run build; npm run build:demo
  6. cd apps/simple
  7. npm run start:simple
  8. Open a webrowser using the link shown in the console and go to the JupyterLite example
  9. Click activate

Expected behavior

Expecting the packages to load successfully

Context

  • JupyterLite version: 0.1.0-beta.14
  • Operating System and version: any
  • Browser and version: any

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
bollwyvlcommented, Nov 8, 2022

have not loaded / setup the service worker

as a quick fix, you could roll back and hard pin to a version that doesn’t include the service worker/unified contents, then, e.g. b9. things are not going to work the way one expects if it’s half-deployed.

otherwise, you’d need to correctly wire up the service worker before debugging files-in-kernels: for production sites, you’d absolutely want the serviceworker, if possible, as it provides a substantial cache benefit, especially for pyodide.

server log - are you referring to logs that might be produced by the JupyterLiteServer instance?

web server. what files actually get served. again, this would be easiest with a binder/readthedocs/CI log, basically anything other than having to debug your code locally.

0reactions
stevejpurvescommented, Dec 7, 2022

Turns out the error above was due to webpack misconfiguration(!) resulting in files with .whl extensions that actually only contained webpack export statements. Closing this as there is a separate issue open for adding the service worker https://github.com/executablebooks/thebe/issues/575

Read more comments on GitHub >

github_iconTop Results From Across the Web

Integrate `thebe-core` by stevejpurves · Pull Request #554
get juptyerlite working again, see: BadZipFile Error when launching pyodide kernel via JuptyerLiteServer jupyterlite/jupyterlite#864
Read more >
Ability to use Pyodide from a service worker - Devscope.io
I'd like to be able to run Python code in a service worker using Pyodide. ... BadZipFile Error when launching pyodide kernel via...
Read more >
JupyterLite jupyterlite Issues - Giters
JupyterLite jupyterlite: Wasm powered Jupyter running in the browser. ... BadZipFile Error when launching pyodide kernel via JuptyerLiteServer.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found