0

i create app with command npx create-react-app my-app --template typescript. Then i made all steps to add it to gh pages - like usual - add homepage,scripts, deploy it etc. The only problem is that it didnt worked. It didnt work on my project so i create empty cra like this and it dont work also. I dont know what can be issue. Page shows info

Loading failed for the with source “https://siemacotam.github.io/static/js/main.aa2ba350.js”.

this is package.json

{
"homepage ": "http://siemacotam.github.io/portfolio2",
"name": "portfolio2",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.4.1",
"@types/node": "^16.11.25",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "5.0.0",
"typescript": "^4.5.5",
"web-vitals": "^2.1.4"
},
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
  "react-app",
  "react-app/jest"
]
},
"browserslist": {
"production": [
  ">0.2%",
  "not dead",
  "not op_mini all"
],
"development": [
  "last 1 chrome version",
  "last 1 firefox version",
  "last 1 safari version"
]
},
"devDependencies": {
"gh-pages": "^3.2.3"
}

}

any ideas ?

  • Base URL is `/`, React tries to load from root, which is not right because the assets are in the subfolder. [Guide](https://skryvets.com/blog/2018/09/20/an-elegant-solution-of-deploying-react-app-into-a-subdirectory/) – kelsny Feb 23 '22 at 15:16
  • I tried that solution but it didnt helped. I just cant understand, because I've made this a lot of times - create cra and add to ghpages. The problem shows when i add typescript template. Index.ts and app.ts are both in src like always in cra. index html in public – Grzegorz Celek Feb 23 '22 at 16:07

0 Answers0