fix: startup error

This commit is contained in:
2026-02-23 12:51:27 +01:00
parent 7213b6b78d
commit 77ddacd52a
3 changed files with 16 additions and 4 deletions

View File

@@ -1,3 +1,9 @@
export function resolvePyodideIndexURL(workerModuleUrl: string): string {
export function resolvePyodideIndexURL(workerModuleUrl: string): string | undefined {
const parsed = new URL(workerModuleUrl);
if (parsed.protocol !== 'file:') {
return undefined;
}
return new URL('../../../node_modules/pyodide/', workerModuleUrl).toString();
}

View File

@@ -183,8 +183,9 @@ json.dumps(__bds_entrypoints)
async function bootstrapRuntime(): Promise<void> {
try {
const indexURL = resolvePyodideIndexURL(import.meta.url);
runtime = await loadPyodide({
indexURL: resolvePyodideIndexURL(import.meta.url),
...(indexURL ? { indexURL } : {}),
stdout: (chunk) => {
if (!activeRequestId) {
return;