I'm trying to deploy a React app to a *.github.io page, and it seems as though something in the process isn't properly getting React to run on the server side - I'm getting a blank page with an error about an unexpected token '<', which suggests to me that React simply isn't being used to interpret the javascript at all.
Here's my package.json:
"name": "github-pages-page",
"homepage": "**********.github.io",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.1.1",
"@testing-library/user-event": "^13.5.0",
"gh-pages": "^3.2.3",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"predeploy": "npm run build",
"deploy": "gh-pages -d 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"
]
}
}
I've installed gh-pages through Yarn and am deploying the app through npm run deploy (which runs just fine), and I've pointed Github Pages to the gh-pages branch properly. If I run yarn start in my local copy of the app's top-level directory, it works exactly as expected, so there's nothing wrong with the app itself - the problem is in however Github Pages is running it. What do I need to tweak to get it to run properly?