Ntl dev no longer working with Eleventy

For some time now, I’ve used the following command to start Netlify:

 netlify dev -c "eleventy --serve --quiet"

This has worked fine for months if not longer. Now when I run it (and my netlify CLI is updated to the latest), I get:

◈ Starting Netlify Dev with Eleventy
✖ Waiting for framework port 8080. This can be configured using the 'targetPort' property in the netlify.toml
◈ Netlify Dev could not connect to localhost:8080.
◈ Please make sure your framework server is running on port 8080

I’ve checked, I don’t have anything blocking 8080. In fact, I can run eleventy --serve --quiet just fine, it’s just failing under netlify dev.

Do you have a netlify.toml file present? I recall having about the same issue (although it was with a different SSG) and I believe I fixed it by adding a basic configuration to netlify.toml

[dev]
  command = 'npx @11ty/eleventy --serve'
  port = 8888

I added this to my toml, and instead of running with -c, I just tried ntl dev. No change.

It’s almost as if ntl is no longer waiting for Eleventy. I get the error like immediately after I see the “Waiting” msg.

I just tried a random eleventy setup with ntl dev, and it’s working.

1 Like

Possibly related issues are

None of these apply to me. ntl is definitely not hanging, it errors out pretty quickly.

I can’t reproduce this on my laptop, and my desktop Node’s version was definitely a bit of out date, but updating to stable didn’t help.

Ok, I tried debugging and I’m seeing something interesting:

⠋ Waiting for framework port 8080. This can be configured using the 'targetPort' property in the netlify.toml  wait-port Socket error: Error: connect ECONNREFUSED 127.0.0.1:8080 +0ms
  wait-port Socket not open: ECONNREFUSED +0ms
  wait-port Socket status is: false +0ms
  wait-port Socket error: Error: getaddrinfo ENOTFOUND localhost +21ms
  wait-port Socket cannot be opened: ENOTFOUND +0ms
  wait-port Unhandled error occured trying to connect: ConnectionError: The address 'localhost' cannot be found +0ms

I don’t have anything running on 8080 and I’ve got no clue as to why localhost wouldn’t be found.

I just tried ping localhost and it correctly hits 127.0.0.1.

Update. I noticed how the CLI was mentioning Eleventy and though to myself - maybe the CLI is assuming Eleventy is already running? In my .toml file I set it to use #static as a framework and now it works. Described it a bit more here: Issue working with Eleventy, seems to be project detection? · Issue #5166 · netlify/cli · GitHub

Hey @cfjedimaster,

I noticed that you’ve filed an issue on the CLI repo - thanks! Hopefully, the devs would engage with you directly.