Github Pages requesting wrong url when deploying react app

Migars RP

After publishing my react app, I noticed the page was blank, after going to the network tab on inspect, I realized Github pages was requesting:

/assets/index-1acd6362.js

instead of:

/project-name/assets/index-1acd6362.js

My package.json already has the correct url on the homepage field.

https://github.com/migars123/react-league-champs

https://migars123.github.io/react-league-champs/

kennarddh

homepage in package.json is for create-react-app

For vite you need to set base in vite config to your github repo name

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  base: '/react-league-champs/'
})

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Deploying react app to github pages

Deploying React App from Codesandbox to Github Pages

Deploying and updating a React App to Github Pages correctly

Issue deploying React app on Github pages

`window.location.href` does not work on react app when deploying on github pages

I see 404 when after deploying my react app to github pages

Github pages still shows README after deploying React app

Deploying react app to github pages is publishing a blank page

404 when Deploying Angular 6 app to github pages

Deploying my react app on github

React-router issues with deploying github pages, with create-react-app

Understanding React deployment - what exactly is going on in the "Deploying a React App to Github Pages" tutorial?

Problem while deploying `create-react-app` on github using `gh-pages`

Deploying React App to Git Hub Pages failed

React App - Div is centered on local host but not when deployed to github pages

React app only displays the background color when deployed to github pages

React Router URL on github pages

Deploying a react app @ username.github.io

Images are not loading after deploying angular app on github pages

Deploying Angular App to Github Pages with angular-cli-ghpages?

404 Failed to load resource Deploying Flutter Web App to GitHub Pages

I'm having an issue with deploying angular app to github pages

Request path is wrong when deployed to github pages

When pushing a React app to GitHub pages, is it required that the default remote branch be `gh-pages`?

wordpress site requesting to wrong url

NPM error when deploying react app to netlify

404 error when deploying react app in Vercel

React app functions correctly on local but not on Github Pages

create react app with github pages, not updating