From 40c299fe611b12a59f69745547b5d449aa83812b Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Thu, 2 May 2024 10:52:11 +0200 Subject: [PATCH] fix: don't panic on empty files in node_modules --- packages/vitest/src/node/pools/rpc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vitest/src/node/pools/rpc.ts b/packages/vitest/src/node/pools/rpc.ts index 5d041b0ee8fd..bd143f966962 100644 --- a/packages/vitest/src/node/pools/rpc.ts +++ b/packages/vitest/src/node/pools/rpc.ts @@ -34,7 +34,7 @@ export function createMethodsRPC(project: WorkspaceProject): RuntimeRPC { if ('id' in result && typeof result.id === 'string') return { id: result.id as string } - if (!code) + if (code == null) throw new Error(`Failed to fetch module ${id}`) const dir = join(project.tmpDir, transformMode)