Error is of type unknown
This is a typescript related error that came up in the catch block. To avoid it we can include a if statement that checks for the instanceof Error
} catch (error) {
if (error instanceof Error) {
alert(error.message)
}
}