vite project showing 404 pages when uploaded to github pages #61478
Replies: 5 comments 17 replies
-
It may be because you have everything inside a folder and nothing at root for Pages to find (such as index.html). |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Thank you everyone for your suggestions. I have included my files. deploy-vite/dist/index.html deploy-vite/package.json deploy-vite/vite.config.js // https://vitejs.dev/config/ These are the files for the project that is giving me the 404 page.I have used netlify, that gives me the blank page. I have done the npm install gh-pages --save-dev, npm run deploy. I have started a new vite project with vite boilerplate and deployed to github pages. I have ran npm run preview which shows properly without errors. |
Beta Was this translation helpful? Give feedback.
-
You can also follow this repo https://github.com/ErickKS/vite-deploy to deploy your react vite app |
Beta Was this translation helpful? Give feedback.
-
in vite config set |
Beta Was this translation helpful? Give feedback.
-
Body
Hi Everyone,
I hope someone can help me as I have been trying to fix this problem for 3 days.
I have deployed a Vite project to github pages, but I get this error message
File not found
The site configured at this address does not contain the requested file.
If this is your site, make sure that the filename case matches the URL as well as any file permissions.
For root URLs (like http://example.com/) you must provide an index.html file.
Firefox dev tools is giving me this error
Content-Security-Policy: The page's settings blocked the loading of a resource at inline ("default-src"). 2 prepareInjection.js:249:78
Content-Security-Policy: The page's settings blocked the loading of a resource at https://saram7619.github.io/favicon.ico ("img-src"). 2 FaviconLoader.jsm:180:19
I have changed my config.js to base: "/deploy-vite/"
my repository is found
repo
Does anyone know how to fix this?
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions