# Errors when handling requests from patreon

**URL:** <https://www.patreondevelopers.com/t/errors-when-handling-requests-from-patreon/5439>\
**Category:** Friendly Help\
**Created:** [April 14, 2022, 12:32am UTC](https://www.patreondevelopers.com/t/errors-when-handling-requests-from-patreon/5439 "2022-04-14T00:32:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spixx](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Spixx](https://www.patreondevelopers.com/u/Spixx)\
**Post date:** [April 14, 2022, 12:32am UTC](https://www.patreondevelopers.com/t/errors-when-handling-requests-from-patreon/5439/1 "2022-04-14T00:32:43Z")

</div>

Im getting an error when ever Patreon sends a request to my system,

```auto
1|Cluster | TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Object
1|Cluster | at new NodeError (node:internal/errors:372:5)
1|Cluster | at Hmac.update (node:internal/crypto/hash:105:11)
1|Cluster | at /root/dev/events/client/ready.js:126:58
1|Cluster | at Layer.handle [as handle_request] (/root/dev/node_modules/express/lib/router/layer.js:95:5)
1|Cluster | at next (/root/dev/node_modules/express/lib/router/route.js:137:13)
1|Cluster | at Route.dispatch (/root/dev/node_modules/express/lib/router/route.js:112:3)
1|Cluster | at Layer.handle [as handle_request] (/root/dev/node_modules/express/lib/router/layer.js:95:5)
1|Cluster | at /root/dev/node_modules/express/lib/router/index.js:281:22
1|Cluster | at Function.process_params (/root/dev/node_modules/express/lib/router/index.js:341:12)
1|Cluster | at next (/root/dev/node_modules/express/lib/router/index.js:275:10) {
1|Cluster | code: 'ERR_INVALID_ARG_TYPE'
1|Cluster | }

```

Here is the line of code which is throwing the error:

```auto
      let hash = crypto.createHmac("md5", webhookSecret).update(request.body).digest("hex");

```

Im a bit confused on what to do since it use to work perfectly fine…

Any help would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [April 14, 2022, 3:29pm UTC](https://www.patreondevelopers.com/t/errors-when-handling-requests-from-patreon/5439/2 "2022-04-14T15:29:42Z")

</div>

This is likely a local issue since there hasnt been a change to the way that webhooks operate.

---

<div class="post-metadata">

**Author:** ![Spixx](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Spixx](https://www.patreondevelopers.com/u/Spixx)\
**Post date:** [April 15, 2022, 9:59am UTC](https://www.patreondevelopers.com/t/errors-when-handling-requests-from-patreon/5439/3 "2022-04-15T09:59:24Z")

</div>

Yeah it was, Thanks for the help!
