From a9112ebb2111f9d7059138a5287a587947606f92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Thu, 29 Feb 2024 13:50:32 +0900 Subject: [PATCH] fix: output correct error for empty import specifier (#16055) --- packages/vite/src/node/plugins/importAnalysis.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/src/node/plugins/importAnalysis.ts b/packages/vite/src/node/plugins/importAnalysis.ts index cb3743395be4cd..e5e3608f7c723c 100644 --- a/packages/vite/src/node/plugins/importAnalysis.ts +++ b/packages/vite/src/node/plugins/importAnalysis.ts @@ -480,7 +480,7 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin { // static import or valid string in dynamic import // If resolvable, let's resolve it - if (specifier) { + if (specifier !== undefined) { // skip external / data uri if (isExternalUrl(specifier) || isDataUrl(specifier)) { return