A quick update. I have no clue if Github changed the default pages route now but according to their docs you must name your repo <username>.github.io. This will automatically be your base route (so https://.github.io). Therefore, in the vite.config.ts, the base path must be
import{defineConfig}from"vite";importreactfrom"@vitejs/plugin-react-swc";importpathfrom"path";import{componentTagger}from"lovable-tagger";exportdefaultdefineConfig(({mode})=>({server:{host:"::",port:8080,},plugins:[react(),mode==='development'&&componentTagger(),].filter(Boolean),resolve:{alias:{"@":path.resolve(__dirname,"./src"),},},base:'/'// Since this will be the base directory}));
Additionally, you need to change the base path destination in the workflow.yaml file accordingly
on:push:branches:-mainpermissions:id-token:writecontents:writepages:writejobs:deploy:runs-on:ubuntu-lateststeps:-name:Checkout codeuses:actions/checkout@v3-name:Setup Node.jsuses:actions/setup-node@v3with:node-version:18-name:Vite GitHub Pages Deployeruses:skywarth/vite-github-pages-deployer@v1.5.0with:public_base_path:/# This is the basebuild_path:./distinstall_phase_node_env:devbuild_phase_node_env:productionpackage_manager:npmartifact_name:github-pagesdebug_mode:falseworking_path:./
my repo name is coderatul.github.io and i set base path to this only
in workflow : public_base_path: /coderatul.github.io/
and in vite config file: base: '/coderatul.github.io/'
and it works maybe you forgot : /repo name/ (the slashesh)
anyway i went through your github and yours seems working with base as / so thanks for commenting this people facing issue might get it right with base as /
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
A quick update. I have no clue if Github changed the default pages route now but according to their docs you must name your repo
<username>.github.io
. This will automatically be your base route (so https://.github.io). Therefore, in thevite.config.ts
, the base path must beAdditionally, you need to change the base path destination in the
workflow.yaml
file accordinglymy repo name is
coderatul.github.io
and i set base path to this onlyin workflow :
public_base_path: /coderatul.github.io/
and in vite config file:
base: '/coderatul.github.io/'
and it works maybe you forgot : /repo name/ (the slashesh)
anyway i went through your github and yours seems working with base as
/
so thanks for commenting this people facing issue might get it right with base as/