New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fails to load Pyodide from external URL in node #3550
Comments
Well |
The problem is here:
|
Using nodeVmMod.runInThisContext(result, {async importModuleDynamically(specifier) { return await import(specifier);}}) fixes that error. But now: Aborted(TypeError: Cannot read properties of undefined (reading 'normalize')) |
I suppose one option would be to write the url to a file and then |
We can fix the next error by patching
|
Hmm, I don't get it. node_resolvePath is defined as follows: nodePath = await import("path");
function node_resolvePath(path: string, base?: string): string {
return nodePath.resolve(base || ".", path);
} and it doesn't seems to return path unchanged. |
Yeah that code should be changed to the following: function node_resolvePath(path: string, base?: string): string {
if(path.includes("://")) {
return path;
}
return nodePath.resolve(base || ".", path);
} But there are lots of problems. I think to fix this we most likely need to patch Emscripten in a couple of places. |
Oh, thanks. I misunderstood what you said. I naively thought that fixing |
Yeah there just seem to be a lot of places where code expects a URL if in browser and a path if in node. I think we could upstream fixes where needed though. |
I am still facing this issue, any updates for it v0.25.0 |
馃悰 Bug
It fails to load Pyodide when we set
indexURL
to some external URL in node.To Reproduce
Environment
Additional context
The problem happens in
resolvePath
path.resolve
that we use in node.js considers URL as a local filesystem path.The text was updated successfully, but these errors were encountered: