In plain words
Async code starts a slow task, like loading rows from Supabase, and gets back a promise, an IOU that await turns into the real result.
Where you see it
Any line with await or .then(). When your Chirp feed flashes "No posts yet" for half a second before the posts appear, that gap is a promise waiting on the database.
What goes wrong
- Forgetting await
Without it you hold the IOU, not the data. posts.map then fails with "posts.map is not a function", because a promise has no map.
const posts = loadPosts(); // a Promise, not posts - Showing "empty" while still loading
Until the promise settles there's no data yet. Without a separate loading state, users see "No posts yet" before the real posts arrive.
- Waiting in a queue for no reason
Three awaits in a row wait three times. Requests that don't depend on each other can run together with Promise.all and finish as fast as the slowest one.
What to tell your agent
Quick check
Sign in to earn +10 XP for itThe code says const posts = loadPosts(); and the page crashes with "posts.map is not a function". What's missing?