0

I am needing help with my deploy. An SPA App build with Express & Sequelize in Backend; React - Redux In FrontEnd. Currently I'm trying to deploy BackEnd at Heroku, getting "Application error" when I try to Open App.

This is the Build Log:

-----> Building on the Heroku-20 stack
-----> Using buildpacks:
       1. https://github.com/timanovsky/subdir-heroku-buildpack
       2. heroku/nodejs
-----> Subdir buildpack app detected
-----> Subdir buildpack in api/
       creating cache: /tmp/codon/tmp/cache
       created tmp dir: /tmp/codon/tmp/cache/subdir9yj6g
       moving working dir: api/ to /tmp/codon/tmp/cache/subdir9yj6g
       cleaning build dir /tmp/build_8e3b9b74
       copying preserved work dir from cache /tmp/codon/tmp/cache/subdir9yj6g to build dir /tmp/build_8e3b9b74
       cleaning tmp dir /tmp/codon/tmp/cache/subdir9yj6g
-----> Node.js app detected
       
-----> Creating runtime environment
       
       NPM_CONFIG_LOGLEVEL=error
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       
-----> Installing binaries
       engines.node (package.json):  >=12.18.3
       engines.npm (package.json):   >=6.14.6
       
       Resolving node version >=12.18.3...
       Downloading and installing node 16.10.0...
       Bootstrapping npm >=6.14.6 (replacing 7.24.0)...
       npm >=6.14.6 installed
       
-----> Restoring cache
       - node_modules
       
-----> Installing dependencies
       Installing node modules (package.json)
       
       up to date, audited 326 packages in 8s
       
       36 packages are looking for funding
         run `npm fund` for details
       
       found 0 vulnerabilities
       
-----> Build
       
-----> Caching build
       - node_modules
       
-----> Pruning devDependencies
       
       up to date, audited 130 packages in 2s
       
       3 packages are looking for funding
         run `npm fund` for details
       
       found 0 vulnerabilities
       
-----> Build succeeded!
-----> Discovering process types
       Procfile declares types     -> (none)
       Default types for buildpack -> web
-----> Compressing...
       Done: 35.3M
-----> Launching...
       Released v16
       https://dogs-parade.herokuapp.com/ deployed to Heroku

This is my package.json:

{
  "name": "api",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "nodemon -L",
    "test": "mocha -w ./tests/**/*.spec.js",
    "dev": "nodemon index.js"
  },
  "author": "Henry",
  "license": "ISC",
  "engines": {
    "node": ">=12.18.3",
    "npm": ">=6.14.6"
  },
  "dependencies": {
    "axios": "^0.21.1",
    "body-parser": "^1.19.0",
    "cookie-parser": "^1.4.5",
    "cors": "^2.8.5",
    "dotenv": "^8.2.0",
    "express": "^4.17.1",
    "ioredis": "^4.19.2",
    "jsonwebtoken": "^8.5.1",
    "morgan": "^1.10.0",
    "node-fetch": "^2.6.1",
    "nodemon": "^2.0.13",
    "pg": "^8.5.1",
    "sequelize": "^6.3.5",
    "uuid": "^8.3.2"
  },
  "devDependencies": {
    "chai": "^4.2.0",
    "mocha": "^8.2.1",  
    "nodemon": "^2.0.13",  
    "supertest": "^6.0.1",
    "supertest-session": "^4.1.0"
  }
}

more logs:

2021-09-25T17:12:58.108309+00:00 heroku[web.1]: Starting process with command `npm start`
2021-09-25T17:12:59.146899+00:00 app[web.1]: 
2021-09-25T17:12:59.146914+00:00 app[web.1]: > api@1.0.0 start
2021-09-25T17:12:59.146914+00:00 app[web.1]: > nodemon -L
2021-09-25T17:12:59.146914+00:00 app[web.1]: 
2021-09-25T17:12:59.151409+00:00 app[web.1]: sh: 1: nodemon: not found
2021-09-25T17:12:59.292193+00:00 heroku[web.1]: Process exited with status 127
2021-09-25T17:12:59.387500+00:00 heroku[web.1]: State changed from starting to crashed
2021-09-25T17:13:04.948348+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=dogs-parade.herokuapp.com request_id=09f97ba0-da58-40a6-a093-72aaf2dd7027 fwd="181.93.184.108" dyno= connect= service= status=503 bytes= protocol=https
2021-09-25T17:13:05.427952+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=dogs-parade.herokuapp.com request_id=4b1e77d4-8ca4-4895-8ebe-7e049ecc6104 fwd="181.93.184.108" dyno= connect= service= status=503 bytes= protocol=https
2021-09-25T17:26:47.524721+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=dogs-parade.herokuapp.com request_id=dc81cce2-c004-4270-bf5d-62c923f54788 fwd="77.182.35.121" dyno= connect= service= status=503 bytes= protocol=https
2021-09-25T17:26:48.044659+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=dogs-parade.herokuapp.com request_id=b85ad081-27f7-41f7-a22b-ef2e9a34e58b fwd="77.182.35.121" dyno= connect= service= status=503 bytes= protocol=https

Can anyone can give me a hand here?

VLAZ
  • 26,331
  • 9
  • 49
  • 67
Martin Gonzalez
  • 77
  • 1
  • 1
  • 12
  • Can you add the error details and when it occurs? – Apoorva Chikara Sep 25 '21 at 16:58
  • Hey Apoorva Chikara! Tnx for your fast reply! I've added more logs at the post, sorry its my first Heroku deploy... the error shows "Application error" when i hit the "open App" button at Heroku website. Still ain't get to deploy Client side of my app – Martin Gonzalez Sep 25 '21 at 17:38
  • 1
    I guess this answer would help you with your issue: https://stackoverflow.com/a/56049723/8135441 – Shafkhan Sep 25 '21 at 19:57

1 Answers1

0

I'm not quite able to spot the issue, however maybe resetting all the dynos in Heroku might do the trick and maybe double checking the environment variables and Procfile just in case. Hope this helps in any way!

  • It works! thanks for your support guys! Shafkan your link solve it. For any1 with the same error: "nodemon not found" you will need to write separate scripts for start and dev, like "start": "node index.js", "dev": "nodemon index.js" – Martin Gonzalez Sep 25 '21 at 20:53