I am deployed my branch using gh-pages
. and it shows as successful. But when i open the page, html
loaded as per my expectation. but source files from assets
folder throws error as 404
.
I have added "private": false,
in my package.json and my browser root is updated like:
import React from "react";
import ReactDOM from "react-dom/client";
import { BrowserRouter } from "react-router-dom";
import App from "./App.tsx";
import "./index.css";
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<BrowserRouter basename={process.env.PUBLIC_URL}>
<App />
</BrowserRouter>
</React.StrictMode>
);
but still getting error as:
not able to understand the exact issue.
2
Answers
Finally I updated my config like this:
works fine for me. thanks
If name of the repo doesn’t follow the format of
<username>.github.io
, then the site will be deployed to<username>.github.io/<your_repo_name>
.It seems that
https://3gwebtrain.github.io/gitaction/
requested/assets/index-d7679c67.js
instead of/gitaction/assets/index-d7679c67.js
.To resolve this, you can try:
demo