Hi guys i have been trying to create a github react repo link to netlify site and my process goes ok until the publishing part, when i click on the published link i get a blank page and apon checking the links in the browser console the URL links for the github linked hosted netlify files are incorrect.
The netlify link github repo build and publishing links gives:
https://timely-truffle-a58322.netlify.app/ (error 404 and blank page).
Apon using the browser tools there are incorrect build links given:
https://timely-truffle-a58322.netlify.app/React-WeatherApp/static/css/main.0f57bf22.css (error 404).
and altering this URL to point to a file link by removing React-WeatherApp from the url:
https://timely-truffle-a58322.netlify.app/static/css/main.0f57bf22.css successfully loads the file.
My github cloned repo (private):
https://github.com/maritimeWeatherUser/React-WeatherApp
The netlify build process builds the site github linked files assuming the root directory is React-WeatherApp and when the build process completes the files are built with timely-truffle-a58322.netlify.app/ as the root directory. The React-WeatherApp directory is not created in the netlify build process and the files are built under the first URL.
How to get my github react repo published in Netlify please.
Here is my package.json file:
{
“version”: “1.0.0”,
“private”: true,
“homepage”: “/React-WeatherApp”,
“dependencies”: {
“fortawesome/fontawesome-svg-core”: “^6.1.1”,
“fortawesome/free-solid-svg-icons”: “^6.1.1”,
“fortawesome/react-fontawesome”: “^0.1.18”,
“testing-library/jest-dom”: “^5.16.4”,
“testing-library/react”: “^13.3.0”,
“testing-library/user-event”: “^14.2.0”,
“types/jest”: “^28.1.0”,
“types/node”: “^17.0.38”,
“types/react”: “^18.0.10”,
“types/react-dom”: “^18.0.5”,
“axios”: “^0.27.2”,
“gh-pages”: “^4.0.0”,
“node-sass”: “^7.0.1”,
“react”: “^18.1.0”,
“react-dom”: “^18.1.0”,
“react-error-boundary”: “^3.1.4”,
“react-indiana-drag-scroll”: “^2.1.0”,
“react-scripts”: “5.0.1”,
“typescript”: “^4.7.2”,
“web-vitals”: “^2.1.4”
},
“scripts”: {
“predeploy”: “npm run build”,
“deploy”: “gh-pages -d build -b deploy”,
“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”
]
}
}
Build command is npm run build for react app using node.js server from local install in linux mint 20 then used python git to upload local repo to github account.
This is the repo i am trying to link and build in netlify.
UPDATE:I have figured two problems first the code repo i am using is excellent to run locally on node but the way he has coded the react app relies on static json data which is not ideal as you have to find a way to auto update the 2 json files for the app to be up to date daily.
Next when the react app is cloned locally and dependencies installed when you launch the app on the local browser no problems, when you try to emulate this by cloning the local repo to github and then connecting this to netlify using netlfiy build process the build is broken. What I have learnt is that i am unfamiliar with the build process for hosting netlify github repos as i installed the react test app into netlify using the mentioned github repo process and this process works on netlify. So something is amiss with the first React app build process at the netlify build stage probably linked to the authors build settings. Also some of the dependencies did not load at netlify build fixed with --legacy–peer–deps but app still wont load when connected to github repo. This same repo works when doing manual build in netlify (drop Build folder in) and also works locally.
type or paste code here