If you are on VSCode (and your issue is not 'lowercase component name' or other issues described in the post), the issue might be that VSCode might be using different TS version than the one your project is on.
Following this fixed my issue:
Credits: https://github.com/vitejs/vite/issues/14011#issuecomment-1732576454