cli: Netlify Dev Server doesn't start on Node 17.x/18.x
Describe the bug
Similar to this: https://github.com/netlify/cli/issues/2882#issue-939909811
Netlify Dev tries to start a server, it injects the environment variables, parses the configuration files and starts the local server of the framework, however it never starts the Netlify CLI’s server.
Till now, the behaviour has been observed with Vite and Create React App (but more frameworks could be affected). This has been observed on MacOS 12. Other Operating Systems have not been checked.
This works with Node 14.17.5, possibly with any other Node version than Node 17.
To Reproduce:
- Use Node 17 (17.0.1 at the time of writing).
- Try running
netlify devin a project (possibly in a Vite or CRA project) - See that the dev server never starts.
Configuration
System:
OS: macOS 12.0.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 891.31 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 17.0.1 - ~/.nvm/versions/node/v17.0.1/bin/node
npm: 8.1.1 - ~/.nvm/versions/node/v17.0.1/bin/npm
Expected behaviour
The Netlify Dev server should start.
CLI Output
Vite:
◈ 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.
Additional context
Marked low-priority as there’s a workaround to use a different Node version.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 21 (4 by maintainers)
also having this issue with node 18!
I just created a bare CRA project and it doesn’t seem to be working with Node 17 at all. Here’s the log:
Doesn’t seem to be related to CLI. The setup works with Node 16. I believe this is because Webpack doesn’t play well with Node 17 yet.
In Gatsby v4 and Node v18. Running
netlify devgets stuck inWaiting for framework port 8000. This can be configured using the 'targetPort' property in the netlify.tomlCan confirm that this issue also persists on Node 18 as well.
My app uses
create-react-app, and like the others on Node@17 (and above including 18), the local webpack server starts, however, the Netlify Dev server (localhost:8888) does not. (Both the react-app content and the functions are not available at 8888)@erezrokah This might be related to https://github.com/vitejs/vite/issues/5365? As per the organisation member:
Its rekt for me too…lets get it going @sw-yx