Skip to content

Commit f6ac860

Browse files
authored
fix: make import resolution failures easier to track down (#2450)
1 parent 5ec13d8 commit f6ac860

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/vite/src/node/plugins/importAnalysis.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,10 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
172172

173173
if (!resolved) {
174174
this.error(
175-
`Failed to resolve import "${url}". Does the file exist?`,
175+
`Failed to resolve import "${url}" from "${path.relative(
176+
process.cwd(),
177+
importer
178+
)}". Does the file exist?`,
176179
pos
177180
)
178181
}

0 commit comments

Comments
 (0)