React vite.js page shows empty page on deploy

Thanks @Khmlwugh

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.

1 Like