Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: "EISDIR: illegal operation on a directory, realpath" error on RA… #13655

Merged

Conversation

datacutter
Copy link
Contributor

Fix "EISDIR: illegal operation on a directory, realpath" error on RAM and virtual disks in Windows, which bypass Mounting Manager (like ImDisk).

Description

On virtual and RAM disks in Windows which bypass the Mounting Manager (e.g. ImDisk), the error "EISDIR: illegal operation on a directory, realpath" occurs when calling fs.realpathSync.native.
These functions require the disk volume to be managed by the Mount Manager to find mount points, etc. ImDisk does not interact with Mount Manager at all, so all such operations will end in an error.
The solution to this problem is the try catch code wrapper.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

…M and virtual disks in Windows, which bypass Mounting Manager (like ImDisk).
@stackblitz
Copy link

stackblitz bot commented Jun 27, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@patak-dev patak-dev added windows only p2-to-be-discussed Enhancement under consideration (priority) labels Jul 4, 2023
patak-dev
patak-dev previously approved these changes Jul 5, 2023
Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! cc @userquin in case you have comments about this PR

@KrishnaPG
Copy link

Facing same issue. Can this be merged, please?

@patak-dev patak-dev enabled auto-merge (squash) July 18, 2023 16:13
@patak-dev patak-dev merged commit 6bd5434 into vitejs:main Jul 18, 2023
@qub1n
Copy link

qub1n commented Feb 21, 2024

Are you sure the bug is fixed? (According to release notes in 4.4.5 (2023-07-20))

I can reproduce it vite "4.4.9.

$ node "./scripts/commands/preProcessSpec.js"
Preprocess spec
[Error: EISDIR: illegal operation on a directory, realpath 'C:\git\xxx....@babel'] {
errno: -4068,
code: 'EISDIR',
syscall: 'realpath',
path: 'C:\git\xxx..........\node_modules\@babel'
}

I just map the RAM disk to node_modules and start a build

@patak-dev
Copy link
Member

@qub1n please avoid commenting on old PRs. If you tested on the latest version of Vite (5.1.4), and you think there is something in core that could be improved, please create a new issue with a minimal reproduction against latest (and more info about your system and setup).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-to-be-discussed Enhancement under consideration (priority) windows only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants