triggerdotdev / trigger.dev

Trigger.dev is the open source background jobs platform for TypeScript.

Home Page:https://trigger.dev/changelog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: Missing Adaptor for Shopify Integration

ramadanomar opened this issue · comments

Provide environment information

System:
OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
CPU: (16) x64 AMD Ryzen 7 3800X 8-Core Processor
Memory: 4.98 GB / 7.73 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 20.9.0 - /run/user/1000/fnm_multishells/360_1716363433225/bin/node
Yarn: 1.22.21 - /run/user/1000/fnm_multishells/360_1716363433225/bin/yarn
npm: 10.1.0 - /run/user/1000/fnm_multishells/360_1716363433225/bin/npm
pnpm: 9.1.2 - ~/.local/share/pnpm/pnpm

Describe the bug

There is an issue with the current shopify integration version beta.33 where there is no adaptor implementation. This issue happens both on the cloud enviroment and self hosted (fly.io - docker image) version.

image

Patching the adaptor with pnpm fixes this issue

Patch File
diff --git a/dist/index.mjs b/dist/index.mjs
index 8ac687e936ae2bf87663942406bf927a1e9075b4..0d8e7e9bce9238d49c61f07e974d36ebb45baf5f 100644
--- a/dist/index.mjs
+++ b/dist/index.mjs
@@ -1,3 +1,4 @@
+import '@shopify/shopify-api/adapters/node';
 import { WebhookTrigger, WebhookSource, verifyRequestSignature, retry, slugifyId } from '@trigger.dev/sdk';
 import { ShopifyError, HttpRetriableError, HttpThrottlingError, shopifyApi, LATEST_API_VERSION, LogSeverity } from '@shopify/shopify-api';
 import { restResources } from '@shopify/shopify-api/rest/admin/2023-10';

Reproduction repo

https://cloud.trigger.dev/orgs/webified-994c/projects/sz-erp-QAr9/jobs/webhook.register.shopify-aea7b74/runs/clwgmgl4edhqhn6305yh861tc/trigger

To reproduce

Example run on the cloud instance:
https://cloud.trigger.dev/orgs/webified-994c/projects/sz-erp-QAr9/jobs/webhook.register.shopify-aea7b74/runs/clwgmgl4edhqhn6305yh861tc/trigger

Additional information

More info about shopify js runtime adaptors can be found here.