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

ntl dev won't start without index.html #4943

Closed
ghost opened this issue Aug 13, 2022 · 1 comment
Closed

ntl dev won't start without index.html #4943

ghost opened this issue Aug 13, 2022 · 1 comment
Labels
type: bug code to address defects in shipped code

Comments

@ghost
Copy link

ghost commented Aug 13, 2022

Describe the bug

Similar to #4845, Netlify CLI won't start on port 8888, gets stuck waiting for framework.

◈ Starting Netlify Dev with Eleventy

> [email protected] 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) is renamed to index.md then ntl dev starts on port 8888.

◈ Starting Netlify Dev with Eleventy

> [email protected] 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 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

##
## 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
@ghost ghost added the type: bug code to address defects in shipped code label Aug 13, 2022
@ghost
Copy link
Author

ghost commented Nov 12, 2022

Closing as not important to me any more.

@ghost ghost closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

0 participants