February 14, 2023, 12:00pm
I’m running into a functions deployment error when deploying via netlify-cli:
args: deploy --dir=$dist_dir/site --functions=$dist_dir/functions --prod
Gives the following output:
- Hashing files...
- Looking for a functions cache...
✔ No cached functions were found
✔ Finished hashing 118 files and 4 functions
- CDN diffing files...
✔ CDN requesting 2 files and 4 functions
- Uploading 6 files
› JSONHTTPError: Unprocessable Entity
Deploy path: /github/workspace/dist/site
Functions path: /github/workspace/dist/functions
Deploying to main site URL...
› Warning: JSONHTTPError: 422
"errors": "Uploaded file must be a non-empty zip"
Why is there the error?
February 14, 2023, 3:51pm
Did you check your function log and see if it was throwing any errors?
Also can you please share your slug so we can look into this further?
February 15, 2023, 10:49am
As far as I can tell the deploy doesn’t reach Netlify, so no logs or errors there.
February 15, 2023, 2:34pm
can you share your slug or site name so I can investigate? Did this work locally before taking this to Netlify?
February 16, 2023, 12:26am
I figured out what the issue was.
I setup the functions folder ages ago but only started trying to deploy the functions the past few days. In the folder there were a few placeholder function files I had added. These had no code in them, totally empty files!
That’s clearly the issue, thanks for your patience.