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
opened 08:35AM - 24 Jul 22 UTC
closed 08:54AM - 30 Sep 22 UTC
type: bug
waiting for upstream
### Describe the bug
Upgraded to latest 10.11.1, running `netlify dev`
It ju… st keeps hanging on "waiting for port forever"
⠋ Waiting for framework port 8080. This can be configured using the 'targetPort' property in the netlify.toml
No matter if I add the `targetPort` to netlify.toml or not, or also whhich port (tried 8080, 8888, 8081 etc)
```shell
valhalla-landers on main [?] via v18.6.0 on ☁️ took 45s
❯ netlify dev
(node:3821) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
wasm streaming compile failed: TypeError: Failed to parse URL from /usr/local/lib/node_modules/netlify-cli/node_modules/netlify-redirector/lib/redirects.wasm
falling back to ArrayBuffer instantiation
◈ Netlify Dev ◈
◈ Ignored general context env var: LANG (defined in process)
◈ Ignored general context env var: LC_ALL (defined in process)
◈ Injected .env file env var: ELEVENTY_ENV
◈ Injected .env file env var: SITE_ID
◈ Injected .env file env var: BROWSER
◈ Injected .env file env var: WCT_API_KEY
◈ Injected .env file env var: UPSTASH_REDIS_REST_URL
◈ Injected .env file env var: UPSTASH_REDIS_REST_TOKEN
◈ Injected .env file env var: UPSTASH_CLOAKING_REDIS_REST_URL
◈ Injected .env file env var: UPSTASH_CLOAKING_REDIS_REST_TOKEN
◈ Injected .env file env var: IPDATA_API_KEY
◈ Loaded function create-redirects.
◈ Loaded function delete-redirects.
◈ Loaded function landers.
◈ Loaded function offers.
◈ Loaded function query.
◈ Functions server is listening on 53716
◈ Starting Netlify Dev with Eleventy
> valhalla-landers@1.0.0 dev
> run-p clean sass webpack:dev 11ty:dev
> valhalla-landers@1.0.0 clean
> rimraf dist/*
> valhalla-landers@1.0.0 sass
> sass resources/scss/main.scss dist/assets/css/main.css
> valhalla-landers@1.0.0 webpack:dev
> webpack --mode development --watch
> valhalla-landers@1.0.0 11ty:dev
> ELEVENTY_ENV=development npx @11ty/eleventy
1 asset
236 modules
webpack 5.69.1 compiled successfully in 1460 ms
[11ty] Writing dist/robots.txt from ./site/robots.njk
[11ty] Writing dist/9ffe3f93-8774-4e12-a1bf-540baec15ebb/index.html from ./site/index.njk
[11ty] Writing dist/70ffc2c1-feb1-47ea-ac72-63b2411ee09c/index.html from ./site/index.njk
[11ty] Writing dist/63e88395-9247-4b88-92c9-1ef649944149/index.html from ./site/index.njk
[11ty] Writing dist/pages/terms-of-use/index.html from ./site/pages/terms-of-use.md (njk)
[11ty] Writing dist/pages/contact/index.html from ./site/pages/contact.md (njk)
[11ty] Writing dist/pages/privacy-policy/index.html from ./site/pages/privacy-policy.md (njk)
[11ty] Writing dist/pages/legal-disclosure/index.html from ./site/pages/legal-disclosure.md (njk)
[11ty] Writing dist/404.html from ./site/404.md (njk)
[11ty] Writing dist/pages/about/index.html from ./site/pages/about.md (njk)
[11ty] Benchmark 798ms 54% 1× (Data) `./site/_data/valhalla.js`
[11ty] Copied 5 files / Wrote 10 files in 1.02 seconds (102.0ms each, v1.0.0)
⠙ Waiting for framework port 8080. This can be configured using the 'targetPort' property in the netlify.toml
```
My `package.json` scripts & deps:
```json
"scripts": {
"help": "npx @11ty/eleventy --help",
"clean": "rimraf dist/*",
"sass": "sass resources/scss/main.scss dist/assets/css/main.css",
"webpack:dev": "webpack --mode development --watch",
"webpack:prod": "webpack --mode production",
"11ty:dev": "ELEVENTY_ENV=development npx @11ty/eleventy --serve --watch",
"11ty:prod": "ELEVENTY_ENV=production npx @11ty/eleventy",
"dev": "run-p clean sass webpack:dev 11ty:dev",
"prod": "run-s sass 11ty:prod webpack:prod"
},
"dependencies": {
"@babel/runtime": "^7.17.2",
"@upstash/redis": "^1.0.3",
"alpinejs": "^3.9.1",
"axios": "^0.27.2",
"base64-url": "^2.3.3",
"ipdata": "^1.1.2",
"unfetch": "^4.2.0"
},
"devDependencies": {
"@11ty/eleventy": "^1.0.0",
"@11ty/eleventy-navigation": "^0.3.2",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/runtime-corejs3": "^7.17.2",
"babel-loader": "^8.2.3",
"clean-css": "^5.2.4",
"gorko": "^0.4.1",
"html-minifier": "^4.0.0",
"netlify-cli": "^10.11.1",
"node-html-parser": "^4.1.0",
"npm-run-all": "^4.1.5",
"postcss": "^8.3.5",
"purgecss": "^4.1.3",
"resolve-url-loader": "^4.0.0",
"rimraf": "^2.7.1",
"sass": "^1.49.9",
"webpack": "^5.69.1",
"webpack-cli": "^4.9.2"
}
```
### Steps to reproduce
Upgrade to latest version, use netlify.toml and package.json i posted here (I assume)
### Configuration
```toml
[build]
build = "/"
command = "npm run prod"
publish = "dist"
[dev]
command = "npm run dev"
framework = "eleventy"
publish = "dist"
[[headers]]
# Define which paths this specific [[headers]] block will cover.
for = "/*"
[headers.values]
Referrer-Policy = "no-referrer"
X-Frame-Options = "DENY"
X-Robots-Tag = "noindex"
X-XSS-Protection = "1; mode=block"
[functions]
# Directory with serverless functions, including background functions,
# to deploy. This is relative to the base directory if one has been set,
# or the root directory if a base hasn’t been set.
directory = ".netlify/functions"
```
### Environment
❯ npx envinfo --system --binaries --npmPackages netlify-cli --npmGlobalPackages netlify-cli
System:
OS: macOS 12.4
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Memory: 919.10 MB / 32.00 GB
Shell: 3.4.1 - /usr/local/bin/fish
Binaries:
Node: 18.6.0 - /usr/local/bin/node
npm: 8.13.2 - /usr/local/bin/npm
npmPackages:
netlify-cli: ^10.11.1 => 10.11.1
npmGlobalPackages:
netlify-cli: 10.11.1
opened 05:04AM - 13 Aug 22 UTC
closed 07:18AM - 12 Nov 22 UTC
type: bug
### Describe the bug
Similar to #4845, Netlify CLI won't start on port 8888, ge… ts stuck waiting for framework.
```
◈ Starting Netlify Dev with Eleventy
> 11ty-test@1.0.0 start
> eleventy --serve
[11ty] Writing _site/page/index.html from ./page.md (liquid)
[11ty] Wrote 1 file in 0.07 seconds (v1.0.1)
[11ty] Watching…
[Browsersync] Access URLs:
-----------------------------------
Local: http://localhost:8080
External: http://192.168.0.137:8080
-----------------------------------
[Browsersync] Serving files from: _site
⠴ Waiting for framework port 8080. This can be configured using the 'targetPort' property in the netlify.toml
```
Through testing, this is due to the lack of an `index` file. If `page.md` (see [demo repository](https://github.com/jasiqli/11ty-test)) is renamed to `index.md` then `ntl dev` starts on port `8888`.
```
◈ Starting Netlify Dev with Eleventy
> 11ty-test@1.0.0 start
> eleventy --serve
[11ty] Writing _site/index.html from ./index.md (liquid)
[11ty] Wrote 1 file in 0.10 seconds (v1.0.1)
[11ty] Watching…
[Browsersync] Access URLs:
-----------------------------------
Local: http://localhost:8080
External: http://192.168.0.137:8080
-----------------------------------
[Browsersync] Serving files from: _site
✔ Waiting for framework port 8080. This can be configured using the 'targetPort' property in the netlify.toml
┌─────────────────────────────────────────────────┐
│ │
│ ◈ Server now ready on http://localhost:8888 │
│ │
└─────────────────────────────────────────────────┘
[11ty] File changed: .netlify/edge-functions-import-map.json
[11ty] Writing _site/index.html from ./index.md (liquid)
[11ty] Wrote 1 file in 0.01 seconds (v1.0.1)
[11ty] Watching…
[Browsersync] Reloading Browsers...
```
> ***Note:** Renaming `index.md` back to `page.md` after this results in `ntl dev` starting as there is (now) an `index.html` file in `_site`.*
The only option *(that I have found if not wanting a root `index.html`)* is to configure `ntl dev` with a custom framework *(see `netlify.toml` in [demo repository](https://github.com/jasiqli/11ty-test) or below)* in which case it will start without the presence of `index.html`.
### Steps to reproduce
Configure a basic Eleventy project (or clone https://github.com/jasiqli/11ty-test)
Run `ntl dev` *(or `ntl dev -o`)
### Configuration
```toml
##
## If there is no `index.html` in the build output, a custom framework needs
## setting so that `netlify dev` will start.
##
# [dev]
# framework = "#custom"
# command = "eleventy --serve"
# targetPort = 8080
```
### Environment
```
System:
OS: macOS 12.5
CPU: (12) x64 Intel(R) Core(TM) i5-10600 CPU @ 3.30GHz
Memory: 33.07 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.16.0 - /usr/local/bin/node
npm: 8.11.0 - /usr/local/bin/npm
npmGlobalPackages:
netlify-cli: 10.17.4
```
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: Systems without IPv6 support crash netlify dev · 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.