kit: SvelteKit : "dev" and "build" commands regularly blocked by EPERM errors (Windows)
Describe the bug
Very often my local build or dev is blocked by the same “EPERM: operation not permitted, stat $types.d.ts” errors on Sveltekit build and sometime dev too
Error is :
EPERM: operation not permitted, stat …/.svelte-kit/ … /$types.d.ts
Makes dev experience really not optimal, I often have to run the same command 2 or 3 times or close / repopen VSCode
Reproduction
npx turbo run dev --filter=SvelteKitProject --no-daemon --no-update-notifier
npx turbo run build --filter=SvelteKitProject --no-daemon --no-update-notifier
Workaround
Seems to work for build but NOT for dev :
Remove-Item -Recurse -Force 'apps\WingMan\.svelte-kit' ; npx turbo run build --filter=SvelteKitProject --no-daemon --no-update-notifier
Logs
SvelteKitProject:build: error during build:
SvelteKitProject:build: Error: EPERM: operation not permitted, stat '[path]\TurboRepo\apps\SvelteKitProject\.svelte-kit\types\src\routes\$types.d.ts'
SvelteKitProject:build: at Object.statSync (node:fs:1690:3)
SvelteKitProject:build: at file:///[path]/TurboRepo/node_modules/.pnpm/@sveltejs+kit@1.25.1_svelte@4.2.1_vite@4.4.9/node_modules/@sveltejs/kit/src/core/sync/write_types/index.js:95:22
SvelteKitProject:build: at Array.map (<anonymous>)
SvelteKitProject:build: at write_all_types (file:///[path]/TurboRepo/node_modules/.pnpm/@sveltejs+kit@1.25.1_svelte@4.2.1_vite@4.4.9/node_modules/@sveltejs/kit/src/core/sync/write_types/index.js:94:27)
SvelteKitProject:build: at create (file:///[path]/TurboRepo/node_modules/.pnpm/@sveltejs+kit@1.25.1_svelte@4.2.1_vite@4.4.9/node_modules/@sveltejs/kit/src/core/sync/sync.js:32:8)
SvelteKitProject:build: at Module.all (file:///[path]/TurboRepo/node_modules/.pnpm/@sveltejs+kit@1.25.1_svelte@4.2.1_vite@4.4.9/node_modules/@sveltejs/kit/src/core/sync/sync.js:58:15)
SvelteKitProject:build: at config (file:///[path]/TurboRepo/node_modules/.pnpm/@sveltejs+kit@1.25.1_svelte@4.2.1_vite@4.4.9/node_modules/@sveltejs/kit/src/exports/vite/index.js:298:34)
SvelteKitProject:build: at runConfigHook (file:///[path]/TurboRepo/node_modules/.pnpm/vite@4.4.9_@types+node@18.17.1/node_modules/vite/dist/node/chunks/dep-df561101.js:66272:31)
SvelteKitProject:build: at async resolveConfig (file:///[path]/TurboRepo/node_modules/.pnpm/vite@4.4.9_@types+node@18.17.1/node_modules/vite/dist/node/chunks/dep-df561101.js:65715:14)
SvelteKitProject:build: at async build (file:///[path]/TurboRepo/node_modules/.pnpm/vite@4.4.9_@types+node@18.17.1/node_modules/vite/dist/node/chunks/dep-df561101.js:47852:20)
SvelteKitProject:build: ELIFECYCLE Command failed with exit code 1.
SvelteKitProject:build: ERROR: command finished with error: command ([path]\TurboRepo\apps\SvelteKitProject) pnpm run build exited (1)
SvelteKitProject#build: command ([path]\TurboRepo\apps\WingMan) pnpm run build exited (1)
System Info
System:
OS: Windows 10 10.0.19043
CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
Memory: 3.72 GB / 15.74 GB
Binaries:
Node: 18.17.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 9.6.7 - C:\Program Files\nodejs\npm.CMD
pnpm: 8.8.0 - ~\AppData\Local\pnpm\pnpm.EXE
Browsers:
Edge: Spartan (44.19041.1266.0)
Internet Explorer: 11.0.19041.1566
npmPackages:
@sveltejs/adapter-auto: ^2.1.0 => 2.1.0
@sveltejs/kit: ^1.25.1 => 1.25.1
svelte: ^4.2.1 => 4.2.1
vite: ^4.4.9 => 4.4.9
Severity
annoyance
Additional Information
tsconfig is
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"paths": {
"$src/*": ["./src/*"],
"$lib": ["./src/lib"],
"$lib/*": ["./src/lib/*"],
"$components": ["./src/lib/components/*"],
"$components/*": ["./src/lib/components/*"]
}
},
"exclude": [
"./node_modules/**",
"./.svelte-kit/**",
"./dist/**",
"./build/**",
"./.svelte/**",
"./.vercel_build_output/**",
"./.vercel/**",
"./coverage/**",
"**/_/**"
]
}
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (7 by maintainers)
We work on Windows unfortunately. This happens many many times.