diff --git a/packages/vite/src/node/plugins/importAnalysis.ts b/packages/vite/src/node/plugins/importAnalysis.ts index bf2ff5c07e760c..f04cb8625f864b 100644 --- a/packages/vite/src/node/plugins/importAnalysis.ts +++ b/packages/vite/src/node/plugins/importAnalysis.ts @@ -294,7 +294,7 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin { if (ssr) { return [url, url] } - this.error( + return this.error( `Failed to resolve import "${url}" from "${path.relative( process.cwd(), importerFile diff --git a/packages/vite/src/node/plugins/importAnalysisBuild.ts b/packages/vite/src/node/plugins/importAnalysisBuild.ts index c431ec2d1ef31a..f392cfda538584 100644 --- a/packages/vite/src/node/plugins/importAnalysisBuild.ts +++ b/packages/vite/src/node/plugins/importAnalysisBuild.ts @@ -189,7 +189,7 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin { if (ssr) { return [url, url] } - this.error( + return this.error( `Failed to resolve import "${url}" from "${path.relative( process.cwd(), importerFile