Task Tracker (Web): TypeError: Cannot read properties of undefined (reading ‘0’) – Realm SDKs

I am following the Task Tracker (Web) react tutorial and am getting this error and I cannot understand why I am getting it because I have followed everything as in the documentation. I am learning realm for the first time
:
E:/Web Dev/Realm/realm-tutorial-web/src/TaskApp.js:13
10 | console.log(app.currentUser.customData)
11 | const [currentProject, setCurrentProject] = React.useState(
12 | // set the current project as “My Project”

13 | app.currentUser.customData.memberOf[0]
| ^ 14 | );
15 | const [isEditingPermissions, setIsEditingPermissions] = React.useState(false);
16 | return (

Read more here: Source link