Error using npm-installed package pyodide in Node for Max: "Cannot read preperties of undefined (reading 'filename')"

Tensen Park's icon

Hi I'm trying to get pyodide working in Node for Max.

All went as expected following this tutorial:
https://docs.cycling74.com/max8/vignettes/02_n4m_usingnpm

For Pyodide, Here are the Node.js install instructions:
https://pyodide.org/en/stable/usage/index.html#node-js

Following the example with the Chance package works well, but with pyodide I get this error:

I've got the same error using the standard Node.js version with Node for Max (v16.6), and Node version v18.11.

Here's my script to reproduce the error:

const maxAPI = require("max-api")
const { loadPyodide } = require("pyodide");

async function hello_python() {
  let pyodide = await loadPyodide();
  return "already crashed here"
}

hello_python().then((result) => {
  maxAPI.outlet(result)
});

Any ideas? I have a feeling it has something to do with the specified paths for this Node for Max project, but I'm not sure.