I get that too. Try either MORE coffee, or LESS coffee. I can never decide which.
Meanwhile, at some point in the course of Unity version releases, the UnityEngine.UI module was moved to be a package in the Package Mangler, and this might cause what you are seeing.
Go sniff about in the Package Mangler (Window → Package Mangler) and it should be in there.
Use caution because there’s a few similarly-named packages.
The one you want is just called “Unity UI”