Why is the Shopify Developer App Failing with Pipedream Connect Due to an Undefined 'shop_id' Property?

This topic was automatically generated from Slack. You can find the original thread here.

Hi there,
I’m experiencing an issue with the Shopify Developer App when using Pipedream Connect that’s preventing my integration from working properly. When calling Shopify Developer App components through Pipedream Connect, the components fail with the error:
TypeError: Cannot read properties of undefined (reading 'shop_id') at Object.getShopId (shopify.app.mjs:250:25)

The components/actions seem to be working fine when i test directly in the Pipedream portal. I am using the same authentication credentials in both places.

It seems the error occurs in the inherited getShopId() method from the base Shopify app. The this.$auth object appears to be undefined or missing the shop_id field. Here is the stack trace:

TypeError: Cannot read properties of undefined (reading 'shop_id')
at Object.getShopId (file:///tmp/__pdg__/dist/code/.../shopify.app.mjs:250:25)
at Object.getShopifyInstance (file:///tmp/__pdg__/dist/code/.../shopify_developer_app.app.mjs:169:24)
at Object._makeGraphQlRequest (file:///tmp/__pdg__/dist/code/.../shopify.app.mjs:261:34)
at Object.createCustomer (file:///tmp/__pdg__/dist/code/.../shopify_developer_app.app.mjs:203:19)

For my authentication configuration:
• Using Pipedream Connect with proper authProvisionId
• External user ID is correctly passed
• Components receive authentication via the nested app structure:

configured_props: {
  "shopify_developer_app": {
    "authProvisionId": "apn_xxxxx"
  },
  // ... other props
}
response = await self.client.actions.run(
                id="shopify_developer_app-action-name",
                external_user_id=self.external_user_id,
                configured_props=configured_props,
)

Is there something I need to do on my side or is there a change required in the shopify_developer_app.app.mjs to override the getShopId() method? Any help would be appreciated.

Thanks!

Can you try it in the demo app and see if you hit the same issue there?

It seems to be working in the demo app

Interesting, so there seems to be something with your payload most likely — is there any discernible difference?

Oh wait… I just found the issue. I was using “shopify_developer_app” in my configured props instead of “shopify”.

Thank you for providing that demo app - i didnt know it existed

Ah, cool

The Shopify apps are pretty confusingly named, unfortunately

Yea, no problem. I plan to add Python examples to the Debug tab soon also.