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

ENOENT: no such file or directory, open ...\_metadata.json (Windows only) #12836

Closed
6 of 7 tasks
fwouts opened this issue Apr 12, 2023 · 2 comments
Closed
6 of 7 tasks
Assignees
Labels
feat: deps optimizer Esbuild Dependencies Optimization pending triage

Comments

@fwouts
Copy link
Contributor

fwouts commented Apr 12, 2023

Describe the bug

Since I migrated the Preview.js codebase to the 4.3 beta, the tests have become very flaky, failing pretty much every time on Windows.

The error always looks like:

@previewjs/plugin-svelte:e2e-test: 2:47:14 AM [vite] error while updating dependencies:
@previewjs/plugin-svelte:e2e-test: Error: ENOENT: no such file or directory, open 'D:\a\previewjs\AppData\Local\Temp\svelte-1096\node_modules\.previewjs\v20.0.1\vite\deps_temp_236434d7\_metadata.json'
@previewjs/plugin-svelte:e2e-test:     at Object.openSync (node:fs:601:3)
@previewjs/plugin-svelte:e2e-test:     at Object.writeFileSync (node:fs:2249:35)
@previewjs/plugin-svelte:e2e-test:     at Object.commit (file:///D:/a/previewjs/previewjs/node_modules/.pnpm/vite@4.3.0-beta.4_@types+node@18.15.11/node_modules/vite/dist/node/chunks/dep-a36bfc56.js:44090:18)
@previewjs/plugin-svelte:e2e-test:     at commitProcessing (file:///D:/a/previewjs/previewjs/node_modules/.pnpm/vite@4.3.0-beta.4_@types+node@18.15.11/node_modules/vite/dist/node/chunks/dep-a36bfc56.js:43542:40)
@previewjs/plugin-svelte:e2e-test:     at runOptimizer (file:///D:/a/previewjs/previewjs/node_modules/.pnpm/vite@4.3.0-beta.4_@types+node@18.15.11/node_modules/vite/dist/node/chunks/dep-a36bfc56.js:43580:23)
@previewjs/plugin-svelte:e2e-test:     at onCrawlEnd (file:///D:/a/previewjs/previewjs/node_modules/.pnpm/vite@4.3.0-beta.4_@types+node@18.15.11/node_modules/vite/dist/node/chunks/dep-a36bfc56.js:43765:17)
@previewjs/plugin-svelte:e2e-test:     at processTicksAndRejections (node:internal/process/task_queues:95:5)
@previewjs/plugin-svelte:e2e-test: 2:47:14 AM [vite] error while updating dependencies:
@previewjs/plugin-svelte:e2e-test: TypeError: Cannot read properties of undefined (reading 'browserHash')
@previewjs/plugin-svelte:e2e-test:     at commitProcessing (file:///D:/a/previewjs/previewjs/node_modules/.pnpm/vite@4.3.0-beta.4_@types+node@18.15.11/node_modules/vite/dist/node/chunks/dep-a36bfc56.js:43557:116)
@previewjs/plugin-svelte:e2e-test:     at runOptimizer (file:///D:/a/previewjs/previewjs/node_modules/.pnpm/vite@4.3.0-beta.4_@types+node@18.15.11/node_modules/vite/dist/node/chunks/dep-a36bfc56.js:43580:17)

Example of failed CI runs:

Reproduction

https://github.com/fwouts/previewjs

Steps to reproduce

I haven't been able to reproduce this on a local Windows machine, and looking at the code it looks like a directory that should exist has perhaps been deleted too early (or not been created?), so I suspect this is a race condition.

System Info

GitHub CI, vite@4.3.0-beta.5, windows-2022, node-18.x

Used Package Manager

pnpm

Logs

No response

Validations

@bluwy bluwy added the feat: deps optimizer Esbuild Dependencies Optimization label Apr 12, 2023
@sun0day
Copy link
Member

sun0day commented Apr 13, 2023

I met this error before. Reproduced when vite dev server receives two HTML requests. I will dig into it later

@fwouts
Copy link
Contributor Author

fwouts commented Apr 19, 2023

This isn't happening anymore since upgrading to 4.3.0-beta.7 :)

@fwouts fwouts closed this as completed Apr 19, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: deps optimizer Esbuild Dependencies Optimization pending triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants