Functions won't deploy: "Function is not valid for deployment."

I have a project which is working just fine locally when using netlify dev but when I try to deploy, the functions aren’t working. The Netlify UI shows 0 functions in the functions tab, so it appears they are not being built and deployed at all? The deploy log is telling me: “Function is not valid for deployment. Please check that it matches the format for the runtime.” What am I missing?

One of my functions is really simple: it takes a URL and returns the HTML for that page. That’s it. Here’s essentially the entirety of it:

Plz help?


Site name: readlists.jim-nielsen.com

Deploy log:

9:59:23 PM: Build ready to start
9:59:25 PM: build-image version: 9d79ad851d6eff3969322d6e5b1df3d597650c41
9:59:25 PM: build-image tag: v3.3.19
9:59:25 PM: buildbot version: 8e2e5a3a5212190d0490c1372e313994f9085345
9:59:25 PM: Fetching cached dependencies
9:59:26 PM: Starting to download cache of 3.6MB
9:59:26 PM: Finished downloading cache in 147.346613ms
9:59:26 PM: Starting to extract cache
9:59:26 PM: Finished extracting cache in 40.019348ms
9:59:26 PM: Finished fetching cache in 188.892297ms
9:59:26 PM: Starting to prepare the repo for build
9:59:26 PM: Preparing Git Reference refs/heads/master
9:59:27 PM: Different functions path detected, going to use the one specified in the Netlify configuration file: 'functions' versus 'functions/' in the Netlify UI
9:59:27 PM: No build command found, continuing to publishing
9:59:27 PM: Starting to deploy site from 'www'
9:59:27 PM: Function "epub": Go binary is not a linux executable
9:59:27 PM: Function "epub": Function is not valid for deployment. Please check that it matches the format for the runtime.
9:59:27 PM: Function "html": Go binary is not a linux executable
9:59:27 PM: Function "html": Function is not valid for deployment. Please check that it matches the format for the runtime.
9:59:27 PM: Creating deploy tree 
9:59:27 PM: Creating deploy upload records
9:59:27 PM: 0 new files to upload
9:59:27 PM: 0 new functions to upload
9:59:28 PM: Starting post processing
9:59:28 PM: Post processing done
9:59:28 PM: Site is live
9:59:28 PM: Finished processing build request in 2.816755086s

netlify.toml file

Just found this little nugget in the functions docs:

Your site must have a build command. If your site doesn’t require a build step, you can set the build command to # .

Once I changed my build command to # I was on my way to getting the proper feedback to get my functions working (had to properly setup zip-it-and-ship-it to build my functions as well—I thought netlify did this for me when specifying a functions directory (which it does for netlify-dev, but apparently it does not for your builds).

1 Like