rollup-plugin-copy icon indicating copy to clipboard operation
rollup-plugin-copy copied to clipboard

Error: EEXIST: file already exists

Open lucascurti opened this issue 5 years ago • 4 comments

Given the following config:

copy({
    targets: [{ src: ["dist", "package.json"], dest: "testing" }],
    hook: "writeBundle",
    verbose: true,
  });

I'm getting the following error. The files are been copied though.

rollup v2.7.2
bundles src/index.tsx → dist/index.cjs.js, dist/index.esm.js...
copied:
copied:
[!] (plugin copy) Error: EEXIST: file already exists, mkdir 'testing/dist'
Error: EEXIST: file already exists, mkdir 'testing/dist'

  dist → testing/dist
  package.json → testing/package.json

lucascurti avatar Apr 27 '20 18:04 lucascurti

Having the same issue - rollup just throws that error message and then hangs. Any clues @vladshcherbin ? Thanks!

happyteque avatar Jul 06 '20 14:07 happyteque

I just ran into this error (only when I have hook: "writeBundle" set) using rollup 2.60.0 and rollup-plugin-copy 3.4.0

andyford avatar Dec 09 '21 12:12 andyford

Facing the same issue!

architgarg avatar Dec 31 '21 16:12 architgarg

same problem

georgezouq avatar Jul 04 '22 01:07 georgezouq

I have the same problem

PavelGonzales avatar May 02 '23 14:05 PavelGonzales

UPD: I change the hook from "writeBundle" to "closeBundle" and it works for me.

PavelGonzales avatar May 02 '23 14:05 PavelGonzales

Proposed fix was released in 3.5.0 under copySync option.

I've tried to replicate the error locally with no luck, hopefully this option will help resolve the errors you have, guys. I'd be happy to see a reproduction repo to better tackle the reason.

vladshcherbin avatar Sep 02 '23 11:09 vladshcherbin