I got the same error,
but I was able to resolve it in my repository my-repo
the steps are as follows,
- Previously the base in my config was
base: '/REPO/'
according to the documentation but got the error, then I changed vite.config.js to:
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
base: './',
plugins: [react()],
})
However, you can follow the documentation to change the base to '/REPO/' or follow the base above
- then, deploy according to the documentation instructions with github actions vite.doc
- Or you can use the gh-pages package
npm install gh-pages --save-dev
- add script package.json and
npm run deploy
"deploy": "gh-pages -d dist",
- change the branch to (gh-pages) which will be deployed