alexmojaki / pyodide-worker-runner

MIT License
23 stars 2 forks source link

Pyodide v26/v27 #37

Closed Hephaistos7 closed 2 months ago

Hephaistos7 commented 2 months ago

Hello, Does this package still work with the new filestructure from Pyodide v26/v27?

I seem to get an error and I want to rule out that somebody else already has v26/v27 running with this pyodide-worker-runner.

Error message when updating Pyodide from v23 to v27:

pyodide.worker.ts:55 Fetching package from 1c591f2a44177c3c32cde578c06c1c71.gz...
index.js:1 Fetched package
pyodide.mjs:1 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'filesystems')
    at pyodide.mjs:1:11595
    at pyodide.mjs:1:15802
    at callRuntimeCallbacks (pyodide.asm.js:10:135477)
    at preRun (pyodide.asm.js:10:4914)
    at run (pyodide.asm.js:10:1230612)
    at runCaller (pyodide.asm.js:10:1230098)
    at removeRunDependency (pyodide.asm.js:10:6272)
    at receiveInstance (pyodide.asm.js:10:9133)
    at receiveInstantiationResult (pyodide.asm.js:10:9273)
(anonymous) @ pyodide.mjs:1
(anonymous) @ pyodide.mjs:1
callRuntimeCallbacks @ pyodide.asm.js:10
preRun @ pyodide.asm.js:10
run @ pyodide.asm.js:10
runCaller @ pyodide.asm.js:10
removeRunDependency @ pyodide.asm.js:10
receiveInstance @ pyodide.asm.js:10
receiveInstantiationResult @ pyodide.asm.js:10
Promise.then
asyncGeneratorStep @ asyncToGenerator.js:12
_next @ asyncToGenerator.js:22
(anonymous) @ asyncToGenerator.js:27
(anonymous) @ asyncToGenerator.js:19
b @ index.js:1
23067 @ pyodide.worker.ts:53
__webpack_require__ @ bootstrap:19
(anonymous) @ bootstrap:32
__webpack_require__.O @ chunk loaded:23
__webpack_require__.x @ bootstrap:33
Promise.then
__webpack_require__.x @ startup chunk dependencies:3
(anonymous) @ startup:2
(anonymous) @ startup:2
Show 14 more frames

Notably, on line 53 in the pyodide.worker.ts, I call:

const reloader = new PyodideFatalErrorReloader(async () => {  # line 53
  const pyodide = await loadPyodideAndPackage(
    {url: customLibrary, format: 'tar'},
    localPyodideLoader,
  );
  return pyodide;
});
alexmojaki commented 2 months ago

@baclemen apparently got it working with v26 in https://github.com/alexmojaki/pyodide-worker-runner/pull/36, I'm afraid I haven't had time to take a look at it.

alexmojaki commented 2 months ago

Pyodide 0.26.2 should work now.