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
vite.createServer() exits if process.env.CI != 'true' #4196
Comments
Same problem in Electron environment. I use Vite's JavaScript APIs to create a server in my entry point. Then call electron to start it. It works with vite@2.3.8 but exits with vite@2.4.1 silently. I compared the source code and found out the same code block makes it happened as |
Is this related to #4082? |
It works with vite 2.4.2. Thanks. Seems |
Thanks for the quick fix :) |
Describe the bug
Today I spent a few hours tracking down some odd behavior in vite. I was using the dev server middleware like this:
When I ran this within
docker-compose run
it worked, but when I useddocker-compose up
it would just immediately exit:It turns out this was because of this block from vite:
I suggest removing this block, as a middleware should not be causing a program exit in any case. It's also undesirable behavior, since it may be running in a process with no stdin.
At the very least it shouldn't die silently.
Reproduction
I think the snippet above makes it clear why this happens.
System Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: