Fix production worker isolation headers

This commit is contained in:
achraf
2026-06-08 00:11:02 +02:00
parent d819552596
commit 906715d343
2 changed files with 28 additions and 1 deletions

View File

@@ -115,7 +115,16 @@ function runPluginInWorker<TOptions>(
const onError = (e: ErrorEvent) => {
cleanup();
discardPluginWorker(plugin, worker);
reject(new Error("Worker error: " + e.message));
const location = e.filename
? ` (${e.filename}${e.lineno ? `:${e.lineno}:${e.colno}` : ""})`
: "";
reject(
new Error(
`Worker failed to load or execute${location}: ${
e.message || "check worker, CORS, and cross-origin isolation headers"
}`
)
);
};
context.signal.addEventListener("abort", onAbort);