Skip to content

Commit

Permalink
fix: avoid crash because of no access permission (#12552)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Mar 23, 2023
1 parent cec2320 commit eea1682
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/vite/src/node/plugins/resolve.ts
Expand Up @@ -138,10 +138,7 @@ export function resolvePlugin(resolveOptions: InternalResolveOptions): Plugin {
// back to checking the path as absolute. If /root/root isn't a valid path, we can
// avoid these checks. Absolute paths inside root are common in user code as many
// paths are resolved by the user. For example for an alias.
const rootInRoot =
fs
.statSync(path.join(root, root), { throwIfNoEntry: false })
?.isDirectory() ?? false
const rootInRoot = tryStatSync(path.join(root, root))?.isDirectory() ?? false

return {
name: 'vite:resolve',
Expand Down

0 comments on commit eea1682

Please sign in to comment.