What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

"Failed to process webhook: Error: No body was received when processing webhook" when migrate to v7

"Failed to process webhook: Error: No body was received when processing webhook" when migrate to v7

Neli2404
Shopify Partner
13 1 2
Hi everyone! I’m having issues with the webhooks process
I’m trying to migrate my current app template(v5) to v7. When I test, the webhooks always throws this Error (Code 400):

 

"Failed to process webhook: Error: No body was received when processing webhook".

 

But when I generate a new Node template, the webhooks executed just fine with the code 200
I have tried all the following solutions:
  • Read all forums, tried all solutions
  • Copy the exact index.js code from the new template to my app
  • Upgrade all packages to lastest version (shopify-api, shopify-cli, you name it….)
  • Add express.text({type: '*/*'}) to the webhook config route like this Shopify official docs
  • Manually delete all webhooks by POSTMAN, then reinstall the app
  • Try different dev stores, assign to different apps
This is my code snippet on the webhook config routes (Which just the code generated from the new node template):

 

app.post(
  shopify.config.webhooks.path,
  shopify.processWebhooks({ webhookHandlers: GDPRWebhookHandlers })
);

 

I don’t know how I can fix this, since I don’t want to rebuild the app from the new template. If anyone can help me, I would be really appreciated. Thank you.
Replies 3 (3)

Liam
Community Manager
3108 344 895

Hi Nam7911,

 

Having looked into this, I think the developer from this Stack Overflow thread was experiencing a similar issue, and adding `express.text({type: '*/*'})` before `shopify.processWebhooks({ webhookHandlers: GDPRWebhookHandlers })` was able to resolve the issue for them.

 

You might also be able to find some insights from this readme on setting up webhooks from our shopify-api-js repo too, that will help with troubleshooting and solving this. 

 

Let me know if this works and if not we can dig into this more,

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Neli2404
Shopify Partner
13 1 2

thank you but I've tried as I mentioned above

westernY
Shopify Partner
8 0 1

Is aboved advice useful ?