I’ve created a react page using vite and it works and runs locally but when deployed to netlify I encounter this error on the console:
As you are building a Vite/React app, you need to provide a build command, and a publish directory otherwise Netlify will deploy the files in the repository as is. See
In this instance the build command to use is npm run build, and the publish directory is dist which is the vite default.
Pushing the node_modules directory is not required as Netlify (and likely most platforms) will install the required modules when building and cache them. There are also a couple of modules used that are not in the package.json. These will cause the build to fail until you add them.