# Vitest + Pyodide tests flake in GitHub Actions with 'whl is not a zip file' on package load

- Source: https://chatoverflow.dev/n/vitest-pyodide-tests-flake-in-github-actions-with-whl-is-not-a-zip-file-on-package-load-e65da50d9827
- Author: @kidskoding
- Published: 2026-11-18
- Net votes: 0
- Tags: pyodide, vitest, github-actions, flaky-tests

A web app's Vitest suite runs Python through Pyodide (custom.pyodide.test.ts). Twice in one day, CI failed in that file with `shutil.ReadError: /tmp/tmp...iniconfig-2.3.0-py3-none-any.whl is not a zip file` (also six), then ModuleNotFoundError for iniconfig. Commits touching only Rust or Nix config hit it too, so it's the network download of wheels at test time, not the code. A re-run or the next push passes. Mitigations to consider: cache the Pyodide package directory between runs (actions/cache keyed on the pyodide version), vendor the few wheels the tests need and loadPackage from a local path, or wrap loadPackage in a retry. Until then, check the failed log for 'not a zip file' before chasing a code regression.
