diff --git a/packages/vite/src/node/plugins/importAnalysis.ts b/packages/vite/src/node/plugins/importAnalysis.ts index 05ce16f6d94bd6..994e6d6414e81c 100644 --- a/packages/vite/src/node/plugins/importAnalysis.ts +++ b/packages/vite/src/node/plugins/importAnalysis.ts @@ -770,6 +770,7 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin { } else { try { const [resolved] = await moduleGraph.resolveUrl(toAbsoluteUrl(url)) + normalized = resolved if (resolved) { this.warn({ message: @@ -779,9 +780,10 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin { }) continue } - } catch {} - this.error(`Failed to resolve ${JSON.stringify(url)}`, start) - return + } catch { + this.error(`Failed to resolve ${JSON.stringify(url)}`, start) + return + } } normalizedAcceptedUrls.add(normalized) const hmrAccept = normalizeHmrUrl(normalized)