Local functions with netlify dev throw ECONNREFUSED error

Hi all, I’m trying out netlify dev so I can try out functions locally, but getting this:

➜  $ netlify dev
◈ Netlify Dev ◈
◈ No app server detected and no "command" specified
◈ Using current working directory
◈ Unable to determine public folder to serve files from
◈ Setup a netlify.toml file with a [dev] section to specify your dev server settings.
◈ See docs at: https://cli.netlify.com/netlify-dev#project-detection
◈ Running static server from "my-proj"

◈ Server listening to 3999

   ┌─────────────────────────────────────────────────┐
   │                                                 │
   │   ◈ Server now ready on http://localhost:8888   │
   │                                                 │
   └─────────────────────────────────────────────────┘

error while proxying request: connect ECONNREFUSED 127.0.0.1:64885

That last line ECONNREFUSED is happening when I make a request to my function (at ./netlify/functions/foo). I’m not sure which network request is failing…the one my function is making to a 3rd party server, or the one from html/js to the function itself. Is there a way to get more verbose output? That port number doesn’t ring a bell, so I’m not sure what’s going on.

I’m not sure if some other configuration is required? I don’t have a build step. Just an index.html file.

hi there, have you tried adding a netlify.toml file as indicated? There may be something else going on, but following the docs indicated would be the first step we’d recommend.

I’m not sure exactly what it was, but I added the netlify.toml with this:

[build]
    functions = "functions/"

and it seems to be working. But I also did a netlify link and also may have been on the wrong URL, since netlify dev output shows you 2 or 3 different addresses and I may have been using the wrong one.