Skip to content

Commit 66e4047

Browse files
committed
improve error message
1 parent b73d6cf commit 66e4047

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/vitest-pool-workers/src/pool/module-fallback.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,11 @@ export async function handleModuleFallbackRequest(
579579
return await load(vite, logBase, method, target, specifier, filePath);
580580
} catch (e) {
581581
debuglog(logBase, "error:", e);
582+
console.error(
583+
`[vitest-pool-workers] Failed to ${method} ${JSON.stringify(target)} from ${JSON.stringify(referrer)}.`,
584+
"To resolve this, we recommend bundling the relevant dependency with Vite.",
585+
"For more details, see: https://developers.cloudflare.com/workers/testing/vitest-integration/known-issues/#module-resolution"
586+
);
582587
}
583588

584589
return new Response(null, { status: 404 });

0 commit comments

Comments
 (0)