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

Error: EXDEV: cross-device link not permitted #10094

Open
shaokeyibb opened this issue Feb 25, 2025 · 0 comments
Open

Error: EXDEV: cross-device link not permitted #10094

shaokeyibb opened this issue Feb 25, 2025 · 0 comments

Comments

@shaokeyibb
Copy link

🐛 bug report

When build artifacts multiple times, there's sometimes an error occurred: Error: EXDEV: cross-device link not permitted, rename *path* -> *anotherPath*.

🎛 Configuration (.babelrc, package.json, cli command)

package.json:

{
  "name": "parcel-test",
  "version": "1.0.0",
  "description": "",
  "source": "src/index.js",
  "main": "dist/main.js",
  "scripts": {
    "watch": "parcel watch",
    "build": "parcel build"
  },
  "browserslist": "> 0.5%, last 2 versions, not dead",
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@parcel/transformer-sass": "^2.13.3",
    "parcel": "^2.13.3"
  }
}

cli command: npm run build

🤔 Expected Behavior

No error should be thrown.

😯 Current Behavior

Error:

Error: EXDEV: cross-device link not permitted, rename 'C:\Users\shaok\AppData\Local\Temp\d3a1b9507cb44047-AssetGraph.3616.3' -> 'D:\ProgramData\WebstormProjects\parcel-test\.parcel-cache\d3a1b9507cb44047-AssetGraph'
    at async Object.rename (node:internal/fs/promises:783:10)
    at async $2a386c23470d420c$export$c4e0ef2ab73c21e7.writeFile (D:\ProgramData\WebstormProjects\parcel-test\node_modules\@parcel\fs\lib\index.js:1149:9)
    at async LMDBCache.setLargeBlob (D:\ProgramData\WebstormProjects\parcel-test\node_modules\@parcel\cache\lib\LMDBCache.js:117:5)
    at async Promise.all (index 1)
    at async RequestTracker.writeToCache (D:\ProgramData\WebstormProjects\parcel-test\node_modules\@parcel\core\lib\RequestTracker.js:868:7)
    at async Parcel._end (D:\ProgramData\WebstormProjects\parcel-test\node_modules\@parcel\core\lib\Parcel.js:221:5)
    at async Parcel.run (D:\ProgramData\WebstormProjects\parcel-test\node_modules\@parcel\core\lib\Parcel.js:213:5)
    at async run (D:\ProgramData\WebstormProjects\parcel-test\node_modules\parcel\lib\cli.js:356:7) {
  errno: -4037,
  code: 'EXDEV',
  syscall: 'rename',
  path: 'C:\\Users\\shaok\\AppData\\Local\\Temp\\d3a1b9507cb44047-AssetGraph.3616.3',
  dest: 'D:\\ProgramData\\WebstormProjects\\parcel-test\\.parcel-cache\\d3a1b9507cb44047-AssetGraph'
}

💁 Possible Solution

It seems that fs.promises.rename is not allowed to move a file across different disk partitions. So replace all fs.promises.rename call to fs.promises.copyFile and fs.promises.unlink should fix this issue.

🔦 Context

It blocks all build actions.

💻 Code Sample

There's nothing more to test this issue, I just create a file src/index.js with only export default {}; and the issue happened.

🌍 Your Environment

Software Version(s)
Parcel 2.13.3
Node v22.14.0
npm/Yarn 10.2.4
Operating System Windows 11 Pro for Workstations Insider Preview 26120.3291
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant