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

bun run --watch just keeps restarting the server over and over #143

Open
andriemc opened this issue Aug 15, 2024 · 5 comments
Open

bun run --watch just keeps restarting the server over and over #143

andriemc opened this issue Aug 15, 2024 · 5 comments

Comments

@andriemc
Copy link

I just made a vite-express app with bun, and when I run it in dev (I changed it from nodemon to bun run --watch instead) it keeps rerunning over and over.

(when using nodemon it works as usual, I changed it to nodemon -w src/server/main.ts -x bun run src/server/main.ts so that bun is used)

@andriemc
Copy link
Author

this also seems to happen when using tsx watch

@carlos-ravelo-ask
Copy link

nodemon on windows also has the same issue, keeps restarting the server.

@andriemc
Copy link
Author

andriemc commented Oct 7, 2024

this is weird

@nick-cheatwood7
Copy link

nick-cheatwood7 commented Oct 14, 2024

this also seems to happen when using tsx watch

Try ignoring the temporary file that vite produces:

{
  "scripts": {
    "dev": "tsx watch --clear-screen=false --ignore \"./vite.config.ts.timestamp*\" server.ts"
  }
}

See tsx documentation.

That seemed to fix the issue for me.

@plymer
Copy link

plymer commented Dec 17, 2024

After following the link that nick-cheatwood7 posted, I found that upgrading to Vite 6+ has removed this issue as Vite is now creating these temporary files within the node_modules folder. It seems nodemon is now not necessary to run vite-express in a dev environment at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants