Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

Issue with receiving webhook body in Vercel environment

18 replies
Last updated: Aug 5, 2021
Hello everyone,
I’m having a problem with Sanity Webhooks.
I’m receiving a Post as expected but without a body.
This started to happen yesterday (08/03/2021).
My Node application is hosted on Vercel, so the first thing I did was to remove Vercel from the problem, and for this, I created an Express locally and with ngrok, I added on sanity.

With this I’m receiving normally the requests but without the body equal on Vercel environment.
Anyone here is having this same issue?
What can I do to solve this problem?
Aug 4, 2021, 8:21 PM
Yes, this is still happen with new webhook.
Aug 4, 2021, 11:03 PM
If you run
sanity hook logs --detailed
in your terminal, do you see a payload?
Aug 4, 2021, 11:05 PM
If you run
sanity hook logs --detailed
in your terminal, do you see a payload?
Aug 4, 2021, 11:05 PM
user A
I did some tests here and Sanity is not sending the Content-Length header in the request, with seems to be mandatory for Vercel to parse the body using their helper.
Aug 5, 2021, 3:55 AM
Interesting. I tested on webhook.site and that header was sent. Can one of you DM your project ID? I’ll do what I can to get this resolved.
Aug 5, 2021, 4:29 AM
Sure. it is tgw6qmr7
Aug 5, 2021, 4:30 AM
Thanks. That’s been passed along.
Aug 5, 2021, 4:35 AM
Thanks. That’s been passed along.
Aug 5, 2021, 4:35 AM
if it helps, these are the headers that I’m receiving on Vercel:
{
    headers: {
        host: '<http://test-ochre-five.vercel.app|test-ochre-five.vercel.app>',
        'content-type': 'application/json',
        'x-real-ip': '34.78.88.4',
        'x-forwarded-host': '<http://test-ochre-five.vercel.app|test-ochre-five.vercel.app>',
        'x-vercel-forwarded-for': '34.78.88.4',
        'x-vercel-deployment-url': '<http://test-ip6v1crs4-businessloans.vercel.app|test-ip6v1crs4-businessloans.vercel.app>',
        'x-vercel-ip-country': 'BE',
        'x-vercel-ip-country-region': 'BRU',
        'x-forwarded-for': '34.78.88.4',
        'x-forwarded-proto': 'https',
        'transfer-encoding': 'chunked',
        'x-vercel-ip-city': 'Brussels',
        'x-vercel-id': 'cdg1::nbmj7-1628138209268-de345b460a33',
        connection: 'close'
    },
    body: {}
}
Aug 5, 2021, 4:40 AM
Can you confirm that you are not receiving the body in any webhook delivery?
Aug 5, 2021, 7:03 AM
user L
I’m working with
user A
and I can confirm that since 2-days ago we are not recieving body in any Webhook delivered.
Aug 5, 2021, 12:16 PM
We found an issue with the JavaScript library used for HTTP requests, are working on a fix
Aug 5, 2021, 12:27 PM
Thanks
user L
, do you have any ETA to this be on production?
Aug 5, 2021, 12:38 PM
user R
Thanks in advance for your work. For now seems to be work again, I will keep a close eye on this for the rest of day and if anything happens I will warn you guys again. Thanks again!
Aug 5, 2021, 12:47 PM
user R
and
user A
thank you for your support in this case. The webhooks are working again.
Aug 5, 2021, 12:59 PM
user R
and
user A
thank you for your support in this case. The webhooks are working again.
Aug 5, 2021, 12:59 PM
Thanks for you too
user L
. Great work guys!
Aug 5, 2021, 1:21 PM
Thank you guys, I was tearing my hair out over this as well
Aug 5, 2021, 1:31 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?