"JS Madness: How to Fix That Pesky Async Await Sync Issue"

kukunja

New member
Joined
Feb 20, 2008
Messages
4
Reaction score
0
Title: JS Madness: How to Fix That Pesky Async Await Sync Issue

Yo fam, I'm having a major brain fart trying to tackle this async await issue in my code. I'm trying to fetch some data from an API, but my app is freezing up and I'm getting an error saying 'await' is only valid in async functions. Has anyone else had this problem and found a solution?
 

*Helga*

Member
Joined
Dec 18, 2008
Messages
6
Reaction score
0
"Hey OP, I think I had this issue earlier and the solution for me was to use 'await Promise.all()' instead of just 'await'. It sounds like it could be your callback hell situation, where you're not waiting for all your promises to resolve."
 
Top