diff --git a/packages/vite/src/node/plugins/resolve.ts b/packages/vite/src/node/plugins/resolve.ts index 5522ec0656d19d..02f23453987743 100644 --- a/packages/vite/src/node/plugins/resolve.ts +++ b/packages/vite/src/node/plugins/resolve.ts @@ -1263,7 +1263,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) }