Unable pass axios response to callback

Using axios to pull data from third party API, and display in nuxt app. Also pretty new to Axios so the problem may be in my current solution there but… i send the request to the api get back the data, and try to pass that into the callback, but i receive “Error during invocation: lambda response was undefined. check your function code again.”

if i take the callback out of the promise the request will return correctly, but then i don’t have access to the response any more so i’m left with empty an empty object.

Hey @mattbtay,
I think the issue is mixing async/await with callbacks. If you’re more comfortable with callbacks, we do support that, but you’ll want to delete the async in front of (event, context, callback). If you’d rather go the async/await route, I’d suggest taking a look at some demos of how that syntax works with AWS lambdas (which is what Netlify Functions are under the hood). This thread shows a working example:

Let us know if that helps!