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

Temporary JS file randomly left un-deleted in .vitepress when user hit CTRL-C upon server start #3382

Closed
4 tasks done
zhangyx1998 opened this issue Dec 26, 2023 · 3 comments
Closed
4 tasks done
Labels
upstream Related to the dependencies

Comments

@zhangyx1998
Copy link
Contributor

Describe the bug

image

Reproduction

This happened several times when I startup the dev server and hit CTRL-C very quickly. Most of the time I just notice the extra file and manually delete it.
But there was one time that I did not notice the tmp file, and mistakenly committed it.

Expected behavior

Maybe consider using cache/ to store bundled user config?

System Info

Not relevant.

Additional context

This seemed to be caused by loadConfigFromFile().

Since this is a Vite API, it seems like we should ask them to add an extra option to specify the output location of temporary config file.

(code to blame)

Let me know if you would like to implement this change. If so, I can open a feature request to Vite.

Validations

@zhangyx1998 zhangyx1998 added the bug: pending triage Maybe a bug, waiting for confirmation label Dec 26, 2023
@brc-dd
Copy link
Member

brc-dd commented Dec 26, 2023

I guess, for now, you can simply have *.timestamp-*.mjs there in .gitignore. I'm not sure if they will be accepting a change there as the module resolution might get messed up depending on the cache directory.

@brc-dd brc-dd added upstream Related to the dependencies and removed bug: pending triage Maybe a bug, waiting for confirmation labels Dec 26, 2023
@zhangyx1998
Copy link
Contributor Author

I guess, for now, you can simply have *.timestamp-*.mjs there in .gitignore. I'm not sure if they will be accepting a change there as the module resolution might get messed up depending on the cache directory.

Nice catch. I'll investigate further before opening an issue on Vite repo.

@zhangyx1998
Copy link
Contributor Author

Closing this issue because upstream is already tracking it at vitejs/vite#13267.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
upstream Related to the dependencies
Projects
None yet
Development

No branches or pull requests

2 participants