fix: plugin script error halting JS execution (#1801)

This commit is contained in:
Marvin Hagemeister
2023-09-20 12:28:32 +02:00
committed by GitHub
parent 0c37b5f9b9
commit 3db514f869
8 changed files with 127 additions and 2 deletions
+27
View File
@@ -0,0 +1,27 @@
/// <reference no-default-lib="true" />
/// <reference lib="dom" />
/// <reference lib="dom.iterable" />
/// <reference lib="dom.asynciterable" />
/// <reference lib="deno.ns" />
import { start } from "$fresh/server.ts";
import manifest from "./fresh.gen.ts";
function throwErr() {
throw new Error("Error thrown");
}
await start(manifest, {
plugins: [
{
name: "thrower",
entrypoints: {
main: `data:application/javascript,export default ${throwErr}`,
},
render(ctx) {
ctx.render();
return { scripts: [{ entrypoint: "main", state: {} }] };
},
},
],
});