fix: startup error
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user