vitejs / vite

Next generation frontend tooling. It's fast!
http://vite.dev
MIT License
68.14k stars 6.14k forks source link

Vite 2.4.0 Broke my setup #4128

Closed mellester closed 3 years ago

mellester commented 3 years ago

Describe the bug

When starting a VITE service via docker it exists with exit code 0 and no apparent error messages Downgrading to 2.3.8 solves the problem for me. And it starts working again

I have a php backend via larravel-sail and use vite for the frontend vue component I have removed everything I thought not really relevant.

Reproduction

https://github.com/mellester/bug-vite-repro/tree/master I have uploaded a repro which reproduces the bug on my system at least. I use docker on wsl2.

I use Laravel sail to deal with docker-composer. In case you aren't familiar 'sail up' after 'composer install' will launch the docker services. Not being very able in docker magic, I felt I needed to include Laravel sail in the repo I included the Laravel basic starter app for completeness. and the basic VITE starter page.

The files I edited heavily are the docker-compose.yaml and they index.js that start the express server.

System Info

System:
    OS: Linux 5.4 Ubuntu 20.04.2 LTS (Focal Fossa)
    CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
    Memory: 133.28 MB / 7.77 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 15.13.0 - ~/.nvm/versions/node/v15.13.0/bin/node
    npm: 7.7.6 - ~/.nvm/versions/node/v15.13.0/bin/npm
  npmPackages:
    @vitejs/plugin-vue: ^1.2.4 => 1.2.4
    vite: ^2.3.8 => 2.3.8

Used Package Manager

npm

Logs

No response

Validations

mellester commented 3 years ago

I have a good faith belief it is a vite bug. however I can be proven wrong about this

vafanassieff commented 3 years ago

I'm having the same issue running vite inside docker does not work but it does outside

wolfgangwalther commented 3 years ago

Same issue here. Vite 2.4.0 now exits with code 0 immediately. Running it inside docker, too.

wolfgangwalther commented 3 years ago

It works when running vite inside a shell started with docker-compose run sh - but it does not when running it with docker-compose up.

Adding tty: true to the service in docker-compose.yml fixed it for me with up, too.

patak-dev commented 3 years ago

Could you check if https://github.com/vitejs/vite/pull/4082 fixes your issues?

wolfgangwalther commented 3 years ago

Could you check if #4082 fixes your issues?

I can confirm it does fix the issue.

patak-dev commented 3 years ago

@mellester you can directly update to vite@2.4.1 to test this

mellester commented 3 years ago

@patak-js it did not fix it by upgrading to 2.4.1 however @wolfgangwalther Adding tty: true to the service in docker-compose.yml fixed it for me with up, too. Did fix it for me

patak-dev commented 3 years ago

Ok, I think we should then close this issue for the moment. Please open a new one that is more specific if you think Vite should still change something and this shouldn't be the responsibility of the user while configuring docker.

wolfgangwalther commented 3 years ago

@mellester you can directly update to vite@2.4.1 to test this

Why would that help? #4082 is not merged, yet, and therefore not part of 2.4.1.

I made the same changes as in #4082 locally and it does indeed fix the issue here - no tty: true needed anymore. But it's certainly not included in 2.4.1, yet.

Ok, I think we should then close this issue for the moment.

It should be closed when merging #4082. Right now the issue still persists, even though there is the workaround I posted above.

patak-dev commented 3 years ago

Thanks @wolfgangwalther, I thought we had managed to merge it before 2.4.1, this will be in the next version then.

olivierchatry commented 3 years ago

would be real cool if you can push a version with this fix :)

patak-dev commented 3 years ago

We are releasing a new patch version every week (Monday/Tuesday), we'll have 2.4.2 soon :)

olivierchatry commented 3 years ago

Thanks a lot !

Le sam. 10 juil. 2021 à 21:07, patak @.***> a écrit :

We are releasing a new patch version every week (Monday/Tuesday), we'll have 2.4.2 soon :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vitejs/vite/issues/4128#issuecomment-877688622, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVOG43JDPS6FN3KZLHSILTXCK7VANCNFSM4725M6ZA .