diff --git a/src/lib/plugins.ts b/src/lib/plugins.ts index 19b1ca9..0aa02bc 100644 --- a/src/lib/plugins.ts +++ b/src/lib/plugins.ts @@ -30,13 +30,11 @@ export async function fetchPlugin(id: string) { try { // by polymanifest spec, plugins should always specify their main file, but just in case pluginJs = await (await safeFetch(id + (pluginManifest.main || "index.js"), { cache: "no-store" })).text(); - } catch { - throw new Error(`Failed to fetch JS for ${id}`); - } - - if (pluginJs.length === 0) throw new Error(`Failed to fetch JS for ${id}`); + } catch {} // Empty catch, checked below } + if (!pluginJs && !existingPlugin) throw new Error(`Failed to fetch JS for ${id}`); + plugins[id] = { id: id, manifest: pluginManifest,