Having issues deploying serverless functions using Netlify API. I have followed this guide and can successfully deploy a site with the file digest method. However Netlify API always returns Error 422 Unprocessable Entity if I include a zipped serverless function.
Thanks for reaching out, and welcome to the Netlify Forums. Sorry to hear you have encountered an obstacle. Can you please share a link to your site as well as the name of your function?
Yes I get that. From what I’ve understood (but please correct me if I’m wrong) the required field is only populated with files not cached by Netlify’s CDN. Currently my site has received those html files but any further deploys bail if I submit a digest that includes a function. So far I have tried sending:
In the past, there was an issue (and it’s not yet fixed) that if you send only a function (without an other static files), it would fail. This is not the case here as you’re sending files too. Your understanding is correct, but the reason why I asked if you are seeing the required array as empty because I tried creating a new site and uploading those files via the API and I’m getting the error as you describe and the required array is turning out to be empty which should not happen.
Apologies for the delay. Can you confirm if you are still experiencing issues? If you are, can you please share additional debugging steps you have taken in the past week? Thanks!
I can see that this problem does exist and would file an escalation for the developers to check. We don’t know if/when this will be fixed, so till then you might have to use some other way.