"Function not found" when serving locally for testing

I can't seem to get supabase functions serve to work for locally testing edge functions on my mac. It will say:
Setting up Edge Functions runtime...
Serving functions on http://127.0.0.1:54321/functions/v1/<function-name>

but then when I try to invoke using e.g. the curl command that comes in the index.ts:

curl -i --location --request POST 'http://127.0.0.1:54321/functions/v1/my-function-name' \
  --header 'Authorization: Bearer [bearer removed]' \
  --header 'Content-Type: application/json' \
  --data '{"name":"Functions"}'


I just get Function not found. Every variation I can think of gives the same result. But I've had no problem using curl to trigger these functions when they are live using something like
curl -i --location --request POST 'http://[project-key].supabase.co/functions/v1/my-function-name' \
  --header 'Authorization: Bearer [bearer removed]' \
  --header 'Content-Type: application/json' \
  --data '{"name":"Functions"}'


Searching here and the web I haven't found the answer so I must be doing something really basic wrong. Any ideas how to troubleshoot?
Was this page helpful?