Promises/Await Issue with 3rd Party Library (Shopify)
See original GitHub issueI’m using lambda to implement a small utility app that interacts with Shopify using this package. However, calling a promise-returning method of the library seems to cut short the execution of the function. It worked fine before I migrated it from Webtask and when testing locally. The code within my express function looks like this:
// function runs until here
const order = await shopify.order.get(orderId);
// but doesn't make it to this point
These are the error logs I’m getting:
CloudWatch log:
{"message": "Internal server error"}
API Gateway log:
Execution failed due to configuration error: Malformed Lambda proxy response
Does anyone know what could possibly be going on?
Issue Analytics
- State:
- Created 5 years ago
- Comments:9
Top Results From Across the Web
Promises/Await Issue with 3rd Party Library (Shopify) #143
I'm using lambda to implement a small utility app that interacts with Shopify using this package. However, calling a promise-returning ...
Read more >Node.js - call async method without using promise third party ...
Promises are built into node and the latest versions of node have implemented support for async/await functions. Here are two ways you could ......
Read more >Promise { pending } Shopify JavaScript Buy SDK
The issue with the current code is that the function doesn't wait for the execution to finish and it ends without you getting...
Read more >Performance best practices for Shopify themes
Reduce your dependency on external frameworks and libraries ... polyfill libraries for very old browsers (anything that doesn't support async / await )....
Read more >JavaScript Callbacks, Promises, and Async Functions: Part 2
Promises have been used for a while in JavaScript libraries, but now you can use them natively in your code. Async functions improve...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@brettstack just missed your comment again! It was a lambda configuration mistake on my end, sorry!
@josephchan91 you need to do async/await if you’re doing try/catch. Otherwise you need to handle errors using the Promise .catch