Thanks to @rozsazoltan for your pointers. I was able to solve my problem. Turns out my vite installation was corrupt and incomplete. I setup a new project and moved all my existing codebase in the new project and it is all good now.