mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-27 06:45:26 +02:00
fix(Code Node): Use an explicit indexURL to load the pyodide runtime (#14487)
This commit is contained in:
parent
9ba58ca80b
commit
860bb1ef92
|
|
@ -1,3 +1,4 @@
|
|||
import { dirname } from 'node:path';
|
||||
import type { PyodideInterface } from 'pyodide';
|
||||
|
||||
let pyodideInstance: PyodideInterface | undefined;
|
||||
|
|
@ -5,7 +6,8 @@ let pyodideInstance: PyodideInterface | undefined;
|
|||
export async function LoadPyodide(packageCacheDir: string): Promise<PyodideInterface> {
|
||||
if (pyodideInstance === undefined) {
|
||||
const { loadPyodide } = await import('pyodide');
|
||||
pyodideInstance = await loadPyodide({ packageCacheDir });
|
||||
const indexURL = dirname(require.resolve('pyodide'));
|
||||
pyodideInstance = await loadPyodide({ indexURL, packageCacheDir });
|
||||
|
||||
await pyodideInstance.runPythonAsync(`
|
||||
from _pyodide_core import jsproxy_typedict
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user