After running vite dev, once it's watching my working directory, saving certain files triggers a restart of the dev server. When this happens, the browser is closed and does not reopen after the dev server restarts. I'm a little new to developing with Vite: I don't have a good grasp of what actions trigger the dev server restart. However, the last time this happened to me was subsequent to saving a change in vite.config.ts: it seems reasonable that the server would restart after this.
When this happens, it effectively breaks the entire watch/automatic reload process, because I have to kill the vite dev process and restart it to spawn a new browser window. I'm not sure if I am using the software incorrectly or if this is a bug, but I would really like to be able to run the dev process and have it automatically update as I save changes. Currently, I'm having to Ctrl+C and restart the dev process seemingly every few times I save.
I saw #138, which seems very similar, and may be another symptom of the same cause. The author of that issue reported manually forcing the dev server to restart, though, and I am not doing that: I am running into this issue after editing and saving files. That issue is also nearly a year old, so I'm hoping my issue has a different fix.
Summary
After running
vite dev
, once it's watching my working directory, saving certain files triggers a restart of the dev server. When this happens, the browser is closed and does not reopen after the dev server restarts. I'm a little new to developing with Vite: I don't have a good grasp of what actions trigger the dev server restart. However, the last time this happened to me was subsequent to saving a change invite.config.ts
: it seems reasonable that the server would restart after this.When this happens, it effectively breaks the entire watch/automatic reload process, because I have to kill the
vite dev
process and restart it to spawn a new browser window. I'm not sure if I am using the software incorrectly or if this is a bug, but I would really like to be able to run thedev
process and have it automatically update as I save changes. Currently, I'm having to Ctrl+C and restart the dev process seemingly every few times I save.I saw #138, which seems very similar, and may be another symptom of the same cause. The author of that issue reported manually forcing the dev server to restart, though, and I am not doing that: I am running into this issue after editing and saving files. That issue is also nearly a year old, so I'm hoping my issue has a different fix.
Here is my current vite.config.ts
Environment