Can't access a function with netlify dev

Hey guys.

I’m currently learning the JAMStack and this course I’m doing uses netlify dev as a sort-of nodemon, which is great. Unfortunately, I can’t get part of it to work.

I used netlify dev to get things started and everything is fine but when I try to access a simple ‘hello world’ serverless function in my function folder, I get this:

Request from ::1: GET /.netlify/functions/hello
Response with status 500 in 7 ms.
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received null
    at validateString (internal/validators.js:118:11)
    at Object.resolve (path.js:980:7)
    at /Users/pedro/.config/yarn/global/node_modules/netlify-cli/src/utils/serve-functions.js:154:21
    at Layer.handle [as handle_request] (/Users/pedro/.config/yarn/global/node_modules/express/lib/router/layer.js:95:5)
    at next (/Users/pedro/.config/yarn/global/node_modules/express/lib/router/route.js:137:13)
    at next (/Users/pedro/.config/yarn/global/node_modules/express/lib/router/route.js:131:14)
    at next (/Users/pedro/.config/yarn/global/node_modules/express/lib/router/route.js:131:14)
    at next (/Users/pedro/.config/yarn/global/node_modules/express/lib/router/route.js:131:14)
    at next (/Users/pedro/.config/yarn/global/node_modules/express/lib/router/route.js:131:14)
    at next (/Users/pedro/.config/yarn/global/node_modules/express/lib/router/route.js:131:14)

My guess is that there’s a conflict between Yarn and Netlify but I just can’t pinpoint what or why. Google doesn’t have anything of help either.

My hello world function is exactly like the example in the Netlify Documentation.

Here’s my netlify.toml:

[build]

functions = 'functions'

Can anybody shine a light on what I’m doing wrong?

Thanks in advance.

Fixed it thanks to an older thread:

The fix is adding a dummy command to your netlify.toml:

[build]
  functions = "functions"
  command = "echo 'this is only here so that netlify deploys functions within folders'"
1 Like

UGH I am having the same problem but this solution does not work for me

hey there, can you say a little more about why this isn’t working for you?