I had exactly the same issue with Vite, React and FastAPI on Windows. Check the registry under HKEY_CLASSES_ROOT.js. Make sure the "Content Type" value is set to "application/javascript". This solved the problem for me.