Skip to content

WASM Emscripten 3.x fails with: Cannot find module 'ws' #146325

Description

@vstinner

First failing build: https://buildbot.python.org/#/builders/1810/builds/2097

0:06:44 load avg: 0.10 [255/501] test_import
0:06:46 load avg: 0.10 [255/501] test_import passed
0:06:46 load avg: 0.10 [256/501] test_importlib
node:internal/modules/cjs/loader:1456
  const err = new Error(message);
              ^
Error: Cannot find module 'ws'
Require stack:
- /home/emscripten/buildarea/3.x.rkm-emscripten.emscripten/build/cross-build/wasm32-emscripten/build/python/python.mjs
    at Module._resolveFilename (node:internal/modules/cjs/loader:1456:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1066:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1071:22)
    at Module._load (node:internal/modules/cjs/loader:1242:25)
    at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
    at Module.require (node:internal/modules/cjs/loader:1556:12)
    at require (node:internal/modules/helpers:152:16)
    at Object.listen (file:///home/emscripten/buildarea/3.x.rkm-emscripten.emscripten/build/cross-build/wasm32-emscripten/build/python/python.mjs:1:99158)
    at ___syscall_listen (file:///home/emscripten/buildarea/3.x.rkm-emscripten.emscripten/build/cross-build/wasm32-emscripten/build/python/python.mjs:1:116282)
    at wasm://wasm/02b65c12:wasm-function[16939]:0x730c5a {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/emscripten/buildarea/3.x.rkm-emscripten.emscripten/build/cross-build/wasm32-emscripten/build/python/python.mjs'
  ]
}
Node.js v24.14.0
program finished with exit code 1

cc @hoodmane

Linked PRs

Activity

  1. vstinner commented on Mar 23, 2026

    @vstinner
    MemberAuthor

    Sadly, "WASM Emscripten 3.x" buildbot doesn't run python -m test.pythoninfo to dump build information. It would be useful to check if something changed between successful build 2096 and failing build 2097.

  2. vstinner commented on Mar 23, 2026

    @vstinner
    MemberAuthor
  3. hoodmane commented on Mar 23, 2026

    @hoodmane
    Contributor

    I'll see if I can reproduce locally. It was introduced #146231 which was a change to importlib and it fails in test_importlib. So hopefully it won't be that mysterious.

  4. hoodmane commented on Mar 23, 2026

    @hoodmane
    Contributor

    The added test test_fastpath_cache_cleared_in_forked_child forks but runs on Emscripten.

  5. added 3 commits that reference this issue on Mar 23, 2026
  6. added a commit that references this issue on Mar 23, 2026
  7. vstinner commented on Mar 23, 2026

    @vstinner
    MemberAuthor

    Fixed by #146330. Thanks for the quick fix!

  8. added a commit that references this issue on Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions