StoicBuilder
Later missionMission 6: Why the spinner comes firstYou can practise it now. It counts once you reach mission 6, after “Cancel that didn't cancel”.Back to HQ

DrillsEvery profile card is empty now

Every profile card is empty now

I the LudusGuildhall, built with CursorWarm-upAbout 4 minFree

What happened

You asked Cursor to move Guildhall's database code out of the profile page and into members.js. Now clicking any member opens an empty white card, and the console shows an error. The members are fine in the database: Ana is right there in the table.

A guild memberClicked Ana's name to message her. Got a white box.
What you seeBrowser console
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'slice') at openProfile (profile.js:7:28)

The MagisterRun it first and read what comes back. Then change the code if you like: your edits go to the review too.

Run it to see the crash. getMember here is a stand-in that loads Ana, member 42.

// Opens a member's profile card. getMember now lives in members.js.
async function openProfile(id) {
  const member = getMember(id);

  const card = {
    title: `${member.name} · ${member.role}`,
    since: member.joinedAt.slice(0, 4),
  };
  console.log(`Profile: ${card.title}, member since ${card.since}`);
  return card;
}

const card = await openProfile(42);

The code runs in your browser against stand-in data. Nothing is sent anywhere.

Your answer

Reviewed by AI against what a good fix needs. About 10 seconds.

Sign in to get your answer reviewed

It's free. Anything you've typed here stays in this browser and is waiting when you come back.

Sign in with email