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

Netlify Dev server doesn't start with Vite #2882

Closed
hrishikesh-k opened this issue Jul 8, 2021 · 3 comments · Fixed by #2883
Closed

Netlify Dev server doesn't start with Vite #2882

hrishikesh-k opened this issue Jul 8, 2021 · 3 comments · Fixed by #2883
Labels
area: frameworks type: bug code to address defects in shipped code

Comments

@hrishikesh-k
Copy link

hrishikesh-k commented Jul 8, 2021

Describe the bug

Netlify Dev server never starts when using Vite.

To Reproduce

Steps to reproduce the behavior:

  1. Setup a basic Vite app as mentioned here: https://vitejs.dev/guide/#scaffolding-your-first-vite-project.
  2. Run netlify dev.
  3. See that the Vite dev server starts, but Netlify Dev server never starts.

Configuration

No extra configuration needed.

Expected behavior

Netlify Dev server at port 8888 should start like it starts with other SSGs like for example create react app.

CLI Output

◈ Netlify Dev ◈
◈ Ignored general context env var: LANG (defined in process)
◈ Starting Netlify Dev with vite

> dev
> vite


  vite v2.4.1 dev server running at:

  > Local: http://localhost:3000/
  > Network: use `--host` to expose

  ready in 217ms.

Expected CLI Output:

(This is from create react app)

◈ Netlify Dev ◈
◈ Ignored general context env var: LANG (defined in process)
◈ Starting Netlify Dev with create-react-app

> [email protected] start
> react-scripts start

ℹ 「wds」: Project is running at http://192.168.0.109/
ℹ 「wds」: webpack output is served from 
ℹ 「wds」: Content not from webpack is served from <path>
ℹ 「wds」: 404s will fallback to /
Starting the development server...

Compiled successfully!

You can now view my-app in the browser.

  Local:            http://localhost:3000
  On Your Network:  http://192.168.0.109:3000

Note that the development build is not optimized.
To create a production build, use npm run build.


   ┌─────────────────────────────────────────────────┐
   │                                                 │
   │   ◈ Server now ready on http://localhost:8888   │
   │                                                 │
   └─────────────────────────────────────────────────┘

Reported by customer(s):

  1. https://answers.netlify.com/t/functions-not-executing-with-vite/40474
@hrishikesh-k
Copy link
Author

hrishikesh-k commented Nov 1, 2021

Hey team,

I believe this is happening again in Netlify CLI 6.14.7 with Vite 2.6.13 and Node 17.0.1.

EDIT: Works fine with Node 14.17.5. Maybe it's just not working with Node 17.x?

@hrishikesh-k hrishikesh-k reopened this Nov 1, 2021
@LuskeyNoah
Copy link

LuskeyNoah commented Nov 5, 2021

I also am having issues getting netlify dev to start on the latest Netlify CLI + node 17.0.1 on macOS Monterey. I am not using vite (using create react app) but the behavior is similar:

-> % netlify dev
◈ Netlify Dev ◈
◈ Ignored general context env var: LANG (defined in process)
◈ Injected .env file env var: XXX
◈ Injected .env file env var: XXX

...

◈ Loaded function XXX.

...

◈ Loaded function XXX.
◈ Loaded function XXX.
◈ Functions server is listening on 50052
◈ Starting Netlify Dev with Create React App

> [email protected] start
> react-scripts start

ℹ 「wds」: Project is running at http://192.168.4.26/
ℹ 「wds」: webpack output is served from 
ℹ 「wds」: Content not from webpack is served from /Users/XXX/XXX/XXX/XXXXX_com/public
ℹ 「wds」: 404s will fallback to /
Starting the development server...

Compiled successfully!

You can now view XXXXXXX_com in the browser.

  Local:            http://localhost:3000
  On Your Network:  http://192.168.4.26:3000

Note that the development build is not optimized.
To create a production build, use npm run build.

The Server now ready never appears.

If this is unrelated, feel free to ignore 😉

@hrishikesh-k
Copy link
Author

Closing this in favour of #3617

As discussed with the team, it was better to open a new issue as it's affecting more than just Vite.

@LuskeyNoah, feel free to watch the new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: frameworks type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants