Description
Description
I understand this might be considered out of scope for vite, but something I frequently experience is the vite dev server crashing when switching branches, mainly due to package version dependency mismatches, causing vite to try to hot reload and (understandably) gets confused by missing packages.
To mitigate this, I quit the vite dev server, run yarn
, and then restart the dev server.
Suggested solution
I'm not sure if there is a viable solution for this. If there was a way to avoid having to restart the vite dev server, perhaps by checking for changes in node_modules or lock files and somehow recognizing that package installers have finished installing the new state, I think it would provide a superior experience. Then users can, if they want, set up automatic installation on branch switching using e.g. husky, and have a seamless branch switching experience even with dependency version mismatches.
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.