Await is a reserved word error

Solution:

In order to use await, the function directly enclosing it needs to be async.
example codes:

async tryGetUserName() {
  let session = await Auth.currentSession();
  ......
}

async should be there, otherwise you will get the error.

LengErrong

ss://Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpqZXN1c2lzbG92ZUAzNS4yMDIuMjM4LjI0Ojg5MTE#Outline

Read More