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

Sporadic writeBundle errors #130

Open
klaemo opened this issue Oct 22, 2024 · 1 comment
Open

Sporadic writeBundle errors #130

klaemo opened this issue Oct 22, 2024 · 1 comment
Labels
needs more info Further information is requested

Comments

@klaemo
Copy link

klaemo commented Oct 22, 2024

Hey there,
I'm copying a bunch of files in my outDir and keep getting sporadic errors. They are rather random, so I don't know how to reproduce them. Looks like a race condition maybe?

Here are the relevant parts of my vite config:

{
    publicDir: './src/assets/_global',
    plugins: [viteStaticCopy({ targets: [{ src: `./src/assets/${publication}/*`, dest: './' }] })],
    build: {
      outDir: `./dist/${publication}`,
    }
}

Example errors:

[[vite-plugin-static-copy:build] ENOENT: no such file or directory, chmod '/Users/clemens.stolle/dev/thing/packages/templates/dist/xxxxx/fallbacks/image-fallback-default.png'
Error: ENOENT: no such file or directory, chmod '/Users/clemens.stolle/dev/thing/packages/templates/dist/xxxxx/fallbacks/image-fallback-default.png'] {
  errno: -2,
  code: 'PLUGIN_ERROR',
  syscall: 'chmod',
  path: '/Users/clemens.stolle/dev/thing/packages/templates/dist/xxxxx/fallbacks/image-fallback-default.png',
  pluginCode: 'ENOENT',
  plugin: 'vite-plugin-static-copy:build',
  hook: 'writeBundle'
}
[[vite-plugin-static-copy:build] EEXIST: file already exists, mkdir '/Users/clemens.stolle/dev/thing/packages/templates/dist/xxxxx/fallbacks'
Error: EEXIST: file already exists, mkdir '/Users/clemens.stolle/dev/thing/packages/templates/dist/xxxxx/fallbacks'] {
  errno: -17,
  code: 'PLUGIN_ERROR',
  syscall: 'mkdir',
  path: '/Users/clemens.stolle/dev/thing/packages/templates/dist/xxxxx/fallbacks',
  pluginCode: 'EEXIST',
  plugin: 'vite-plugin-static-copy:build',
  hook: 'writeBundle'
}
Node.js v20.18.0
vite: 5.4.9
vite-plugin-static-copy: 2.0.0
@sapphi-red
Copy link
Owner

I need a reproduction to check this.

@sapphi-red sapphi-red added the needs more info Further information is requested label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants