InternalServerError: Cannot read property 'webhookSubscriptions' of null

AnEpicName
Tourist
8 1 0

Hi,

I'm trying to create a webhook for this topic: SUBSCRIPTION_BILLING_ATTEMPTS_SUCCESS, and I'm getting the "InternalServerError: Cannot read property 'webhookSubscriptions' of null".

This is my code: 

        const subscriptionBillingSuccessWh = await Shopify.Webhooks.Registry.register({
          shop,
          accessToken,
          path: "/webhooks",
          topic: "SUBSCRIPTION_BILLING_ATTEMPTS_SUCCESS",
          webhookHandler: async (topic, shop, body) => {
            console.log("subsbody", body)
          }
        })


Does someone had a similar issue? I've searched the forums and I can't find the solution.

 

0 Likes
arroyopato
New Member
1 0 0

I came across this question after getting the error "InternalServerError: Cannot read property 'webhookSubscriptions' of null", and after some time working through the issue I realized that I didn't have the proper scope set.  For anyone else who finds this, double-check that you have your SHOPIFY_APP_SCOPES environment variable set to include the scope needed for the webhook you are trying to register.

0 Likes