good-idea / sane-shopify

MIT License
212 stars 15 forks source link

Lambda product update throws error #124

Closed liqueflies closed 3 years ago

liqueflies commented 3 years ago

Hello, i am facing an issue again after updating to 0.18.0

here my log (unminimized)

4:53:12 PM: 2020-11-10T15:53:12.187Z    4b7f18b7-99da-4b6a-87e9-1b2edc4a0451    INFO    TypeError: realFetch.call is not a function
    at module.exports (/var/task/src/lambda/onProductUpdate.js:39097:19)
    at /var/task/src/lambda/onProductUpdate.js:19043:11341
    at s (/var/task/src/lambda/onProductUpdate.js:19043:2319)
    at Generator._invoke (/var/task/src/lambda/onProductUpdate.js:19043:2072)
    at Generator.next (/var/task/src/lambda/onProductUpdate.js:19043:2678)
    at f (/var/task/src/lambda/onProductUpdate.js:19043:456)
    at c (/var/task/src/lambda/onProductUpdate.js:19043:659)
good-idea commented 3 years ago

Dang, I know I have been slow to review issues over here but I didn't realize it had been this long.. Is this error still happening? There are some new docs on debugging in the main readme.

I've primarily used Next.js instead of AWS lambdas, so I'm not super familiar with what might be happening here.

This might be an issue with the usage of fetch in packages/sync-utils/src/shopify/createShopifyClient.ts - we might need to replace this with cross-fetch?

liqueflies commented 3 years ago

Hello, again trying to update this.

For now, I am not seeing any log (success or errors, nothing happens with latest version)

For sure we might replace fetch with 'isomorphic-fetch'. What sounds new to me is that in your nuxt server is working without a node fetch.

liqueflies commented 3 years ago

Forget it. Got it working was a staging password.

error is:

INFO   error on lambda TypeError: r.call is not a function
    at e.exports (/var/task/src/lambda/onProductUpdate.js:65:6155)
    at /var/task/src/lambda/onProductUpdate.js:6:110586
    at c (/var/task/src/lambda/onProductUpdate.js:6:101298)
    at Generator._invoke (/var/task/src/lambda/onProductUpdate.js:6:101051)
    at Generator.next (/var/task/src/lambda/onProductUpdate.js:6:101657)
    at d (/var/task/src/lambda/onProductUpdate.js:6:99436)
    at s (/var/task/src/lambda/onProductUpdate.js:6:99639)

I think is the same as above. I'll try to add an isomorphic fetch and I let you know.

liqueflies commented 3 years ago

Managed the problem and made a fix here -> #159