Answer the question
In order to leave comments, you need to log in
Why is my React app not running on heroku?
I built the app with React Create App using redux. On local hosting everything works, on github.io the app works fine too https://nickeny.github.io/comments-on-React/
But when I try to build the app on Heroku I get a TypeError: Cannot read property 'addComment' of undefined, as if the application itself was written incorrectly.
package.json:
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.6",
"@testing-library/react": "^11.2.0",
"@testing-library/user-event": "^12.2.2",
"express": "^4.17.1",
"path": "^0.12.7",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-redux": "^7.2.2",
"react-scripts": "4.0.0",
"redux": "^4.0.5",
"web-vitals": "^0.2.4"
},
"scripts": {
"start": "node server.js",
"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"
]
},
"description": "This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/nickeny/main.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/nickeny/main/issues"
},
"homepage": "./"
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question