mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(Code Node): Use an explicit indexURL to load the pyodide runtime (#14487)
This commit is contained in:
committed by
GitHub
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
|
||||
|
||||
Reference in New Issue
Block a user