question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Promises/Await Issue with 3rd Party Library (Shopify)

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
josephchan91commented, May 7, 2018

@brettstack just missed your comment again! It was a lambda configuration mistake on my end, sorry!

1reaction
brettstackcommented, May 7, 2018

@josephchan91 you need to do async/await if you’re doing try/catch. Otherwise you need to handle errors using the Promise .catch

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found