diff --git a/packages/vite/src/node/plugins/resolve.ts b/packages/vite/src/node/plugins/resolve.ts index 8b03d363ad40f4..5c88daafcf83ad 100644 --- a/packages/vite/src/node/plugins/resolve.ts +++ b/packages/vite/src/node/plugins/resolve.ts @@ -520,7 +520,7 @@ export function tryOptimizedResolve( if (resolvedSrc == null) { try { // this may throw errors if unable to resolve, e.g. aliased id - resolvedSrc = resolveFrom(id, path.dirname(importer)) + resolvedSrc = normalizePath(resolveFrom(id, path.dirname(importer))) } catch { // this is best-effort only so swallow errors break