I am using Vite with a React project and the JSX extension for all the React files in the app. Before, I could see my app fine after building and previewing, but now receive an error saying ‘react is not defined’. Also, my original error was after I built and deployed my app to GitHub pages, I receive the message:
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of “main/jsx”.
I have made sure that the page deploys into a separate branch, and have tried many solutions of other similar questions to no avail.
Here is the repo: https://github.com/johnwaugh1/johnwaugh1.github.io
1