title: Heroku application crashed: at=error code=H10 desc=“App crashed” method=GET path=“/”
body: <p><strong>*I have been trying to upload my MERN app to Heroku and have been getting these error codes. The web application will run on my local host but the application immediately fails when I try and upload it to heroku. I am relatively new to working with the MERN stack and am trying to figure out how to properly upload an application to Heroku. *</strong></p>
  
  <pre><code>2020-05-26T05:00:40.804369+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=murmuring-fjord-39421.herokuapp.com request_id=9c5806e4-dd49-4325-8814-dccb9f4398e0 fwd="71.204.55.234" dyno= connect= service= status=503 bytes= protocol=https
  2020-05-26T05:00:41.404224+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=murmuring-fjord-39421.herokuapp.com request_id=c325a3c6-b459-4de2-b7f5-fe67457f8d6e fwd="71.204.55.234" dyno= connect= service= status=503 bytes= protocol=httpsenter code here
  2020-05-26T05:01:09.373344+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=murmuring-fjord-39421.herokuapp.com request_id=4ad4f358-063e-48d7-a55e-7ccffc32ffb3 fwd="71.204.55.234" dyno= connect= service= status=503 bytes= protocol=httpsenter code here
  </code></pre>
  
  <p><strong>heroku logs --tail</strong></p>
  
  <pre><code>2020-05-26T04:54:22.910425+00:00 app[api]: Initial release by user woodjack191@gmail.com
  2020-05-26T04:54:22.910425+00:00 app[api]: Release v1 created by user woodjack191@gmail.com
  2020-05-26T04:54:23.096112+00:00 app[api]: Enable Logplex by user woodjack191@gmail.com
  2020-05-26T04:54:23.096112+00:00 app[api]: Release v2 created by user woodjack191@gmail.com
  2020-05-26T04:58:40.000000+00:00 app[api]: Build started by user woodjack191@gmail.com
  2020-05-26T04:59:47.263635+00:00 app[api]: Deploy 7d333fc9 by user woodjack191@gmail.com
  2020-05-26T04:59:47.263635+00:00 app[api]: Release v3 created by user woodjack191@gmail.com
  2020-05-26T04:59:47.283454+00:00 app[api]: Scaled to web@1:Free by user woodjack191@gmail.com
  2020-05-26T04:59:54.000000+00:00 app[api]: Build succeeded
  2020-05-26T04:59:56.664155+00:00 heroku[web.1]: Starting process with command `npm start`
  2020-05-26T04:59:59.487422+00:00 app[web.1]:
  2020-05-26T04:59:59.487434+00:00 app[web.1]: &gt; my-project@0.1.0 start /app
  2020-05-26T04:59:59.487434+00:00 app[web.1]: &gt; react-scripts start
  2020-05-26T04:59:59.487435+00:00 app[web.1]:
  2020-05-26T05:00:02.028314+00:00 app[web.1]: ℹ ｢wds｣: Project is running at http://172.17.10.22/
  2020-05-26T05:00:02.028881+00:00 app[web.1]: ℹ ｢wds｣: webpack output is served from
  2020-05-26T05:00:02.029021+00:00 app[web.1]: ℹ ｢wds｣: Content not from webpack is served from /app/public
  2020-05-26T05:00:02.029167+00:00 app[web.1]: ℹ ｢wds｣: 404s will fallback to /
  2020-05-26T05:00:02.029361+00:00 app[web.1]: Starting the development server...
  2020-05-26T05:00:02.029362+00:00 app[web.1]: 
  2020-05-26T05:00:02.141290+00:00 heroku[web.1]: Process exited with status 0
  2020-05-26T05:00:02.315545+00:00 heroku[web.1]: State changed from starting to crashed
  2020-05-26T05:00:02.318095+00:00 heroku[web.1]: State changed from crashed to starting
  2020-05-26T05:00:09.983236+00:00 heroku[web.1]: Starting process with command `npm start`
  2020-05-26T05:00:12.651901+00:00 app[web.1]: 
  2020-05-26T05:00:12.651922+00:00 app[web.1]: &gt; my-project@0.1.0 start /app
  2020-05-26T05:00:12.651923+00:00 app[web.1]: &gt; react-scripts start
  2020-05-26T05:00:12.651923+00:00 app[web.1]:
  2020-05-26T05:00:16.868981+00:00 app[web.1]: ℹ ｢wds｣: Project is running at http://172.17.178.250/
  2020-05-26T05:00:16.869628+00:00 app[web.1]: ℹ ｢wds｣: webpack output is served from
  2020-05-26T05:00:16.869783+00:00 app[web.1]: ℹ ｢wds｣: Content not from webpack is served from /app/public
  2020-05-26T05:00:16.869929+00:00 app[web.1]: ℹ ｢wds｣: 404s will fallback to /
  2020-05-26T05:00:16.870239+00:00 app[web.1]: Starting the development server...
  2020-05-26T05:00:16.870241+00:00 app[web.1]: 
  2020-05-26T05:00:17.013391+00:00 heroku[web.1]: Process exited with status 0
  2020-05-26T05:00:17.057205+00:00 heroku[web.1]: State changed from starting to crashed
  2020-05-26T05:00:40.804369+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=murmuring-fjord-39421.herokuapp.com request_id=9c5806e4-dd49-4325-8814-dccb9f4398e0 fwd="71.204.55.234" dyno= connect= service= status=503 bytes= protocol=https
  2020-05-26T05:00:41.404224+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=murmuring-fjord-39421.herokuapp.com request_id=c325a3c6-b459-4de2-b7f5-fe67457f8d6e fwd="71.204.55.234" dyno= connect= service= status=503 bytes= protocol=https
  2020-05-26T05:01:09.373344+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=murmuring-fjord-39421.herokuapp.com request_id=4ad4f358-063e-48d7-a55e-7ccffc32ffb3 fwd="71.204.55.234" dyno= connect= service= status=503 bytes= protocol=https
  2020-05-26T05:11:05.245937+00:00 heroku[web.1]: State changed from crashed to starting
  2020-05-26T05:11:14.187854+00:00 heroku[web.1]: Starting process with command `npm start`
  2020-05-26T05:11:16.938860+00:00 app[web.1]:
  2020-05-26T05:11:16.938887+00:00 app[web.1]: &gt; my-project@0.1.0 start /app
  2020-05-26T05:11:16.938887+00:00 app[web.1]: &gt; react-scripts start
  2020-05-26T05:11:16.938887+00:00 app[web.1]: 
  2020-05-26T05:11:18.963210+00:00 app[web.1]: ℹ ｢wds｣: Project is running at http://172.19.50.2/
  2020-05-26T05:11:18.963807+00:00 app[web.1]: ℹ ｢wds｣: webpack output is served from
  2020-05-26T05:11:18.963915+00:00 app[web.1]: ℹ ｢wds｣: Content not from webpack is served from /app/public
  2020-05-26T05:11:18.964030+00:00 app[web.1]: ℹ ｢wds｣: 404s will fallback to /
  2020-05-26T05:11:18.964316+00:00 app[web.1]: Starting the development server...
  2020-05-26T05:11:18.964319+00:00 app[web.1]: 
  2020-05-26T05:11:19.093706+00:00 heroku[web.1]: Process exited with status 0
  2020-05-26T05:11:19.137119+00:00 heroku[web.1]: State changed from starting to crashed
  2020-05-26T05:11:19.140236+00:00 heroku[web.1]: State changed from crashed to starting
  2020-05-26T05:11:26.041885+00:00 heroku[web.1]: Starting process with command `npm start`
  2020-05-26T05:11:28.043546+00:00 app[web.1]: 
  2020-05-26T05:11:28.043558+00:00 app[web.1]: &gt; my-project@0.1.0 start /app
  2020-05-26T05:11:28.043558+00:00 app[web.1]: &gt; react-scripts start
  2020-05-26T05:11:28.043559+00:00 app[web.1]:
  2020-05-26T05:11:29.727646+00:00 app[web.1]: ℹ ｢wds｣: Project is running at http://172.16.13.198/
  2020-05-26T05:11:29.727983+00:00 app[web.1]: ℹ ｢wds｣: webpack output is served from
  2020-05-26T05:11:29.728062+00:00 app[web.1]: ℹ ｢wds｣: Content not from webpack is served from /app/public
  2020-05-26T05:11:29.728128+00:00 app[web.1]: ℹ ｢wds｣: 404s will fallback to /
  2020-05-26T05:11:29.728294+00:00 app[web.1]: Starting the development server...
  2020-05-26T05:11:29.728295+00:00 app[web.1]:
  2020-05-26T05:11:29.800107+00:00 heroku[web.1]: Process exited with status 0
  2020-05-26T05:11:29.835462+00:00 heroku[web.1]: State changed from starting to crashed
  </code></pre>
  
  <p><strong><em>server.js file</em></strong></p>
  
  <pre><code>const bodyParser = require('body-parser');
  const cors = require('cors');
  const path = require('path')
  const app = express();
  require('./database');
  
  app.use(bodyParser.json());
  app.use(cors());
  
  // API
  const users = require('./api/users');
  app.use('/api/users', users);
  
  app.use(express.static(path.join(__dirname, '../build')))
  app.get('*', (req, res) =&gt; {
      res.sendFile(path.join(__dirname, '../build'))
  })
  
  const port = process.env.PORT || 5000;
  app.listen(port, () =&gt; {
      console.log(`Server started on port ${port}`);
  });
  </code></pre>
  
  <p><strong><em>package.json file</em></strong></p>
  
  <pre><code>{
    "name": "my-project",
    "version": "0.1.0",
    "private": true,
    "dependencies": {
      "@testing-library/jest-dom": "^4.2.4",
      "@testing-library/react": "^9.5.0",
      "@testing-library/user-event": "^7.2.1",
      "axios": "^0.19.2",
      "body-parser": "^1.19.0",
      "bootstrap": "^4.5.0",
      "cors": "^2.8.5",
      "express": "^4.17.1",
      "mongoose": "^5.9.15",
      "react": "^16.13.1",
      "react-dom": "^16.13.1",
      "react-scripts": "3.4.1"
    },
    "scripts": {
      "start": "node backend/server.js",
      "heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install npm &amp;&amp; run build",
      "build": "react-scripts build",
      "test": "react-scripts test",
      "eject": "react-scripts eject"
    },
    "eslintConfig": {
      "extends": "react-app"
    },
    "browserslist": {
      "production": [
        "&gt;0.2%",
        "not dead",
        "not op_mini all"
      ],
      "development": [
        "last 1 chrome version",
        "last 1 firefox version",
        "last 1 safari version"
      ]
    },
    "proxy": "http://localhost:5000",
    "engines": {
      "node": "10.16.0"
    }
  }
  </code></pre>