Netlify Dev — What is the expected behaviour?

I’m trying to troubleshoot my netlify functions. It would be a lot easier if I could get netlify dev running, but the docs aren’t clear.

They just say install netlify cli and then run the command netlify dev

When I do this, it generates my static site, and then nothing happens. If i go to localhost:3000 there’s nothing there. I get no errors. It’s like it has worked. But I don’t know where I’m supposed to be looking.

My understanding of netlify dev is it runs a netlify server on my computer. Where does it do this!?

Any help would be much appreciated!

Hi @ShadowfaxRodeo, there’s more information on using netlify dev in the repo at cli/netlify-dev.md at main · netlify/cli · GitHub . You can also find a guide on getting started with gatsby + functions + netlify dev in the following blog post: How to Build Authenticated Serverless JAMstack Apps with Gatsby and Netlify

If you’re still having trouble, please provide more details, including links to your repo so that we can take a look. Thanks.

netlify dev with netlify.toml seems to run both [dev] command = and Netlify server. This allows Netlify functions to be run.

This works.

[dev]
  command = "npm run dev"

This seems to fail, though.

[dev]
  command = "node prerun.js && npm run dev"

@patarapolw, what’s the error you get when running the second command? Is the repo public?