Netlify Dev could not connect to locahost:3000

Hello,

While working on my development server, consistently a few minutes after having run netlify-dev I receive this error and am unable to call my functions until I kill node and restart netlify-dev, I am still able to access my website on port 3000 and make changes without any issues:

◈ Netlify Dev could not connect to localhost:3000.
◈ Please make sure your framework server is running on port 3000

This is really hampering my development and I can’t find a fix online. I am running Windows 10 21H1 and have netlify-lambda 2.0.15 and netlfiy-cli 9.2.0. My netlify.toml file is as follows:

[dev]
framework = “create-react-app”
functionsPort = 3001
[build]
functions = “lambda”
Command = “npm run prod”

1 Like

Are you using Node 17 by any chance? if yes, this might help:

No I am currently using Node 14.17.5

In that case, would it be possible to share the repo?

Not exactly but I may be able to share individual files that could help troubleshoot it, what might you need the package.json, package-lock.json, etc?

I’ve had a similar issue using gatsby v3. Netlify dev starts the gatsby dev server, which finishes, but netlify dev doesn’t recognise that it is ready to start proxying requests. See here:

Seemed like this was fixed by upgrade the netlify cli but I had the same problem today with the latest version.

Obviously it would be helpful to upgrade gatsby to rule out issues but we can’t risk upgrading to v4 right now.

Hey there, @robations :wave:

Thanks for sharing that issue. Would it be possible to share your project repo as well as a link to your site? If not, can you share a reproduction?

@themetzmeier :wave: sharing both your package.json and your package-lock.json would be great. Thanks in advance!

I have a project where me, and other devs on this project, are experiencing this issue.

My repository: GitHub - KenEucker/biketag-vue: A vue app for the biketag game.

I am on Node (v16.13.2) and npm (8.1.2) with yarn (1.22.17) on a vite built web application.

I have found that it’s a “use it or lose it” sort of situation where 10 minutes or so of idle time (no requests made) the server will crash. It’s not always this way, as over time it eventually crashes immediately on a filechange. To be honest it’s hard to know the pattern other than the fact that it crashes with this error every single time without fail (eventually).

Interesting, I don’t think this is a dependency issue on the project itself, I started a new project with virtually zero dependencies and this was still occurring, so it must be my system. I tried disabling power-saving functionality related to network hardware but that did not yield any results either.

Here is the link to a repository having this issue, the package-lock.json and package.json are in the root directory:

I have this same issue and have yet to look into it. I just accepted it as is, but now it’s enough of an inconvenience for me to dig into it. Repo is private unfortunately.

node v17.1.0
npm v8.1.0
netlify-cli v9.13.0

Hey @RHEV

As mentioned earlier in this thread, there is an open issue for node v17. I suggest downgrading to v16 until it is resolved.

1 Like

But I’ve worked so hard not to downgrade thusfar D:

You might have to downgrade. v16 is an LTS release too (v17 is not) so will receive better and longer support as mentioned here.

I’m aware of its’ long term support, but I need to build on 17 so sadly this solution won’t work for me. I’ll dig around when I have some time. Thank you for pointing me in the right direction!

1 Like

Having the same time out issue with stopping Netlify dev server when 10 or so minutes passed.
I’m using Netlify dev server for functions and Vite as web server. netlify-cli/10.1.0 win32-x64 node-v17.3.0
Error message from Netlify dev server:

Netlify Dev could not connect to localhost:3000.
Please make sure your framework server is running on port 3000

whereas my website is accessible on localhost:3000.

The issue regarding Netlify CLI with v17 remains open on GitHub @bomzj (see links in previous posts.) At present the only option I am aware of is to downgrade to v16.

Any suggestions for the people not using Node v17 and still having this issue?

Are you referring to the repository you shared in a previous post @themetzmeier ?