Support Forums

Function within a folder fails to deploy

I have a simple function I create from the “hello” sample in the Netlify Functions documentation. This function works fine locally and when deployed if I have it in functions/hello.js (functions is my top level folder in my repository and my .toml file has functions = “functions”).

However, if I place the file in functions/hello/hello.js it fails to deploy. I can run it locally with netlify dev just fine, but when I look at my deploy log I just see “0 new functions to upload”. I can see the files in GitHub so I know I committed and pushed fine. And the previous function at functions/hello.js is gone after deploy.

What am I missing? The documentation says I should be able to place the file in a folder with the same name. The FaunaDB netlify function create command also puts the files in a folder with the same name as the function.


1 Like

Hi @nalenb, if you don’t mind, can you share the site where the function is failing to deploy?

I tried again last night with a blank project, same thing happened. Here’s the repo:

It’s hooked up to Netlify here:


I added a few notes to the repo’s README to indicate what function is doing what.


It appears I was missing the build command. Functions seem to work fine in the “functions” folder without a build command, but need a build command, even a dummy one, if you have functions inside of folders.

1 Like

thanks for letting us know, @nalenb! I will touch base with some people about whether that is expected behaviour, but i am glad you found a way that works. thanks for sharing it.

It is probably obvious to most, but it wasn’t to me: by “build command”, I think you mean in the netlify.toml file. For future readers who run into the same problem, this line convinced Netlify to start deploying my function inside a folder.

1 Like

Dropping a quick note to say that as of today, a build command is no longer required for deploying Netlify Functions via Git.

1 Like