You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But it's enough to have issues in case of my code.
vite v5.0.10 building for production...
✓ 175 modules transformed.
[vite:dts] Start generate declaration files...
dist/style.css 86.12 kB │ gzip: 11.54 kB
dist/App.js 0.49 kB │ gzip: 0.23 kB
dist/[...].js 1.68 kB │ gzip: 0.67 kB
dist/[...].js 2.43 kB │ gzip: 0.81 kB
dist/[...].js 108.06 kB │ gzip: 18.00 kB
[vite:dts] Start rollup declaration files...
Analysis will use the bundled TypeScript version 5.3.3
[vite:dts] ENOTEMPTY: directory not empty, rmdir 'E:/[...]/app/dist/[component-path]'
✓ built in 18.17s
error during build:
Error: ENOTEMPTY: directory not empty, rmdir 'E:/[...]/app/dist/[component-path]'
at rmdirSync (node:fs:1219:10)
at removeDirIfEmpty (file:///E:/[...]/app/node_modules/vite-plugin-dts/dist/index.mjs:126:5)
at removeDirIfEmpty (file:///E:/[...]/app/node_modules/vite-plugin-dts/dist/index.mjs:111:14)
at removeDirIfEmpty (file:///E:/[...]/app/node_modules/vite-plugin-dts/dist/index.mjs:111:14)
at Object.writeBundle (file:///E:/[...]/app/node_modules/vite-plugin-dts/dist/index.mjs:1004:11)
at async Promise.all (index 0)
at async PluginDriver.hookParallel (file:///E:/[...]/app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:18570:9)
at async file:///E:/[...]/app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:19562:13
at async catchUnfinishedHookActions (file:///E:/[...]/app/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:18986:16)
at async build (file:///E:/[...]/app/node_modules/vite/dist/node/chunks/dep-R0I0XnyH.js:66815:22)
I am close to certain that this is due to how the built-in FS library works on Windows. It is also significant that the folder is indeed non-empty. So it's probably a matter of a race of conditions.
What do I suggest?
I suggest using libraries that already assume such scenarios and allow recursive folder deletion regardless of the operating system (fs-extra?)
Reproduction
Non-applicable
Steps to reproduce
Create scaffolded project npm create vite@latest
Create multilevel nested directories with multiple files, e.g components
Install vite-plugin-dts
Set-up plugin like instructions say, with rollupTypes equal to true
Run vite build or npm run build
Note: I do not have 100% reproductive scenario. In some projects there are this issue, in others works fine.
Describe the bug
I'm just setting
rollupTypes
value totrue
, like:But it's enough to have issues in case of my code.
I am close to certain that this is due to how the built-in FS library works on Windows. It is also significant that the folder is indeed non-empty. So it's probably a matter of a race of conditions.
What do I suggest?
I suggest using libraries that already assume such scenarios and allow recursive folder deletion regardless of the operating system (
fs-extra
?)Reproduction
Non-applicable
Steps to reproduce
npm create vite@latest
vite-plugin-dts
rollupTypes
equal totrue
vite build
ornpm run build
Note: I do not have 100% reproductive scenario. In some projects there are this issue, in others works fine.
System Info
Validations
The text was updated successfully, but these errors were encountered: