I've been trying to implement a login form in Next.js with React-hook-form and the Chakra UI component library but I can't figure out why my form validation error messages won't display despite following the React-hook-form docs quite thoroughly. I have it set up such that username must be 2-30 characters long and the password must be at least 8 characters long; both input fields being required. On a valid form submission, an alert will pop up signifying a successful submission. On an invalid form submission, however, an error message should display beneath the invalid input but that isn't the case. I have noticed, however, that the invalid input field will receive focus on submit.
Here is what I'm looking at: https://codesandbox.io/s/quirky-wave-jgpwf
Thanks in advance.