netlify / framework-info

Framework detection utility
MIT License
137 stars 21 forks source link

ntl dev hangs and times out waiting for port 3000 when a project uses vite as a build tool #791

Closed nickytonline closed 1 year ago

nickytonline commented 2 years ago

Thanks for reporting this bug!

Please search other issues to make sure this bug has not already been reported.

Then fill in the sections below.

Describe the bug

  1. From a shell, create a new project using vite by running npm create vite@latest
  2. Use the default project name vite-project or enter a new one.
➜ npm create vite@latest
✔ Project name: … vite-project
? Select a framework: › - Use arrow-keys. Return to submit.
❯   vanilla
    vue
    react
    preact
    lit
    svelte
  1. It doesn't matter which project type you choose, but I chose React
  2. change to the new folder, e.g. vite-project
  3. run npm run dev
  4. a React vite based app loads uo
  5. Stop the server by pressing CTRL + C
  6. run ntl dev
  7. the vite based server starts up, but the Netlify CLI is hanging waiting for port 3000
➜ ntl dev
◈ Netlify Dev ◈
◈ Ignored general context env var: LANG (defined in process)
◈ Starting Netlify Dev with Vite

> vite-broken-with-ntl@0.0.0 dev
> vite

  VITE v3.0.2  ready in 5255 ms

  ➜  Local:   http://127.0.0.1:5173/
  ➜  Network: use --host to expose
⠧ Waiting for framework port 3000. This can be configured using the 'targetPort' property in the netlify.toml

Configuration

N/A

Pull requests

Pull requests are welcome! If you would like to help us fix this bug, please check our contributions guidelines.

nickytonline commented 2 years ago

I'm going to also validate if this affects the frameworks that use vite and have their own framework info configuration, e.g. Hydrogen.