Sometimes I encounter this random bug where I cannot read properties of null (reading 'useContext'), even though my code doesn't even contain a useContext. In the console, I receive additional information related to usePathname. This issue only occurs on localhost and is very random.
To resolve it, I simply restart the development server, but it's becoming increasingly annoying.