diff --git a/packages/vite/src/node/plugins/resolve.ts b/packages/vite/src/node/plugins/resolve.ts index 7a07313131e6ce..bc71e4a67db50c 100644 --- a/packages/vite/src/node/plugins/resolve.ts +++ b/packages/vite/src/node/plugins/resolve.ts @@ -1264,7 +1264,7 @@ function equalWithoutSuffix(path: string, key: string, suffix: string) { function getRealPath(resolved: string, preserveSymlinks?: boolean): string { resolved = ensureVolumeInPath(resolved) if (!preserveSymlinks && browserExternalId !== resolved) { - resolved = fs.realpathSync(resolved) + resolved = safeRealpathSync(resolved) } return normalizePath(resolved) }