Type Error/warning: Type deliveryMethod... is not assignable to type 'WebhookHandlersParam'.
ConnorIngold opened this issue · 0 comments
ConnorIngold commented
Issue summary
After running, npm create @shopify/app
and looking at the index.js file in VSCode it picks up a type error.
shopify.processWebhooks({ webhookHandlers: GDPRWebhookHandlers.CUSTOMERS_DATA_REQUEST })
The full type error is:
Type '{ deliveryMethod: DeliveryMethod; callbackUrl: string; callback: (topic: any, shop: any, body: any, webhookId: any) => Promise<void>; }' is not assignable to type 'WebhookHandlersParam'.
Property 'deliveryMethod' is incompatible with index signature.
Type 'import("s:/projects/product-installer-plus/product-installer-plus/web/node_modules/@shopify/shopify-api/lib/webhooks/types").DeliveryMethod' is not assignable to type 'WebhookHandler | WebhookHandler[]'.ts(2322)
Basically, Type '{ deliveryMethod: DeliveryMethod; callbackUrl: string; callback: (topic: any, shop: any, body: any, webhookId: any) => Promise; }' is not assignable to type 'WebhookHandlersParam'.
Expected behavior
Not to see any type errors upon generating the app even with the // @ts-check
comment.
Actual behavior
Highlighted type errors in VSCode.
Steps to reproduce the problem
Run npm create @shopify/app
and open index.js