Problem with React/Node.js app deployment on Heroku - node.js

I have problem with deployment of my 'TODO APP' on Heroku. I read multiple articles, tutorials and answers on Stack Overflow, but it still doesn't resolve my problem.
This is my index.js file in root directory:
const express = require('express')
const apiRoute = require('./routes/api/index')
const bodyParser = require('body-parser')
const app = express()
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({
extended: true
}))
app.use('/api', apiRoute)
if (process.env.NODE_ENV === 'production') {
app.use(express.static('client/build'))
const path = require('path')
app.get('*', function(req, res) {
res.sendFile(path.resolve(__dirname, 'client', 'build', 'index.html'))
})
}
const PORT = process.env.PORT || 8000
app.listen(PORT)
In the code below you can see scripts in package.json for root directory:
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"client": "npm run start --prefix client",
"server": "nodemon index.js",
"dev": "concurrently --kill-others-on-fail \"npm run server\" \"npm run client\"",
"start": "node index.js",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
},
In the heroku logs I can see, that "concurrently is not found:
2020-05-18T19:00:50.438389+00:00 app[web.1]: sh: 1: concurrently: not found
2020-05-18T19:00:50.443535+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-05-18T19:00:50.444083+00:00 app[web.1]: npm ERR! syscall spawn
2020-05-18T19:00:50.444495+00:00 app[web.1]: npm ERR! file sh
2020-05-18T19:00:50.444972+00:00 app[web.1]: npm ERR! errno ENOENT
2020-05-18T19:00:50.446708+00:00 app[web.1]: npm ERR! to-do-app#1.0.0 start: `concurrently "npm run server" "npm run client"`
2020-05-18T19:00:50.446990+00:00 app[web.1]: npm ERR! spawn ENOENT
I have tried multiple things, but none of them work. Any ideas please?

In your package.json maybe the script dev is causing an issue.
Try clearing all the scripts and only leave
"start" : "node server.js"
"test": "echo "Error: no test specified" && exit 1"
"heroku-postbuild": "cd client && npm install && npm run build"

Related

Babel-node not found - Heroku Deploy

I am trying to deploy a simple Ecommerce website that has Reactjs , Node, Express and MongoDB. I have followed a tutorial to deploy it to the heroku. I have used babel but in the tutorial, it wasn't used. I know we don't use babel for production and used only for the development purpose, but I am not sure how I would still deploy my website.
The server is working perfectly locally and also the Heroku build is successful. But when I visit my deployed app on heroku it says application error.
Here are the logs from Heroku:
2020-06-29T16:04:44.812179+00:00 heroku[web.1]: Starting process with command `npm start`
2020-06-29T16:04:48.072669+00:00 app[web.1]:
2020-06-29T16:04:48.072690+00:00 app[web.1]: > e-commerce-site#1.0.0 start /app
2020-06-29T16:04:48.072691+00:00 app[web.1]: > babel-node backend/server.js
2020-06-29T16:04:48.072691+00:00 app[web.1]:
2020-06-29T16:04:48.105827+00:00 app[web.1]: sh: 1: babel-node: not found
2020-06-29T16:04:48.110266+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-06-29T16:04:48.111030+00:00 app[web.1]: npm ERR! syscall spawn
2020-06-29T16:04:48.111915+00:00 app[web.1]: npm ERR! file sh
2020-06-29T16:04:48.112482+00:00 app[web.1]: npm ERR! errno ENOENT
2020-06-29T16:04:48.114018+00:00 app[web.1]: npm ERR! e-commerce-site#1.0.0 start: `babel-node backend/server.js`
2020-06-29T16:04:48.114155+00:00 app[web.1]: npm ERR! spawn ENOENT
2020-06-29T16:04:48.114342+00:00 app[web.1]: npm ERR!
2020-06-29T16:04:48.114508+00:00 app[web.1]: npm ERR! Failed at the e-commerce-site#1.0.0 start script.
2020-06-29T16:04:48.114601+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-06-29T16:04:48.133545+00:00 app[web.1]:
2020-06-29T16:04:48.134148+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-06-29T16:04:48.134771+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-06-
29T16_04_48_124Z-debug.log
2020-06-29T16:04:48.213867+00:00 heroku[web.1]: Process exited with status 1
2020-06-29T16:04:48.265610+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-29T16:04:48.268292+00:00 heroku[web.1]: State changed from crashed to starting
2020-06-29T16:04:57.328678+00:00 heroku[web.1]: Starting process with command `npm start`
2020-06-29T16:05:00.299582+00:00 app[web.1]:
2020-06-29T16:05:00.299595+00:00 app[web.1]: > e-commerce-site#1.0.0 start /app
2020-06-29T16:05:00.299595+00:00 app[web.1]: > babel-node backend/server.js
2020-06-29T16:05:00.299596+00:00 app[web.1]:
2020-06-29T16:05:00.308802+00:00 app[web.1]: sh: 1: babel-node: not found
2020-06-29T16:05:00.312668+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-06-29T16:05:00.313206+00:00 app[web.1]: npm ERR! syscall spawn
2020-06-29T16:05:00.313637+00:00 app[web.1]: npm ERR! file sh
2020-06-29T16:05:00.314093+00:00 app[web.1]: npm ERR! errno ENOENT
2020-06-29T16:05:00.315953+00:00 app[web.1]: npm ERR! e-commerce-site#1.0.0 start: `babel-node backend/server.js`
2020-06-29T16:05:00.316283+00:00 app[web.1]: npm ERR! spawn ENOENT
2020-06-29T16:05:00.316613+00:00 app[web.1]: npm ERR!
2020-06-29T16:05:00.316974+00:00 app[web.1]: npm ERR! Failed at the e-commerce-site#1.0.0 start script.
2020-06-29T16:05:00.317312+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-06-29T16:05:00.344371+00:00 app[web.1]:
2020-06-29T16:05:00.344828+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-06-29T16:05:00.345202+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-06-29T16_05_00_319Z-debug.log
2020-06-29T16:05:00.406294+00:00 heroku[web.1]: Process exited with status 1
2020-06-29T16:05:00.466244+00:00 heroku[web.1]: State changed from starting to crashed
File Name: Server.js
The file where I have all the connections for MongoDB:
import express from "express";
import data from "./data";
import dotenv from "dotenv";
import config from "./config";
import mongoose from "mongoose";
import userRoute from "./routes/userRoute";
import productRoute from "./routes/productRoute";
import bodyParser from "body-parser";
dotenv.config();
const mongodbUrl = config.MONGODB_URL;
const PORT = process.env.PORT || 5000;
mongoose.connect(mongodbUrl , {
useNewUrlParser : true,
useUnifiedTopology: true,
useCreateIndex: true
}).catch(error => console.log(error.reason));
const app = express();
app.use(bodyParser.json());
app.use("/api/users" , userRoute);
app.use("/api/products" , productRoute);
if (process.env.NODE_ENV === "production"){
app.use(express.static("./frontend/build"));
}
app.listen(PORT , console.log(`Server started at ${PORT}`));
File Name: config.js
export default{
MONGODB_URL: process.env.MONGODB_URL || "mongodb://localhost/ecommercesite",
JWT_SECRET: process.env.JWT_SECRET || "somethingsecret"
}
File Name: Package.json
{
"name": "e-commerce-site",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build" : "cd frontend && npm run build",
"install-client" : "cd frontend && npm install",
"heroku-postbuild" : "npm run install-client && npm run build",
"start": "babel-node backend/server.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^0.19.2",
"body-parser": "^1.19.0",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"jsonwebtoken": "^8.5.1",
"mongoose": "^5.9.16"
},
"devDependencies": {
"#babel/cli": "^7.10.1",
"#babel/core": "^7.10.1",
"#babel/node": "^7.10.1",
"#babel/preset-env": "^7.10.1",
"nodemon": "^2.0.4"
}
}

My full stack application won't run NodeJS and React concurrently

Running the client server and the backend server independently will produce no errors but mongoDB exits automatically when client and server run concurrently
npm start
[nodemon] 2.0.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `concurrently "npm run client" "npm run server"`
[0]
[0] > roster#0.1.0 client /Users/owner/Documents/projects/roster
[0] > react-scripts start
[0]
[1]
[1] > roster#0.1.0 server /Users/owner/Documents/projects/roster
[1] > cd src/server nodemon index.js
[1]
[1] npm run server exited with code 0
[0] ℹ 「wds」: Project is running at http://192.168.0.4/
[0] ℹ 「wds」: webpack output is served from
[0] ℹ 「wds」: Content not from webpack is served from /Users/owner/Documents/projects/roster/public
[0] ℹ 「wds」: 404s will fallback to /
[0] Starting the development server...
A snippet of my package.json. I'm running npm start from the root folder roster.
"scripts": {
"start": "concurrently \"npm run client\" \"npm run server\" ",
"server": "cd src/server nodemon index.js",
"client": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
require('dotenv').config();
const express = require('express');
const handle = require('./handlers');
const cors = require('cors');
const bodyParser = require('body-parser');
const mongoose = require('mongoose');
const app = express();
app.use(bodyParser.json());
app.use(cors());
app.use(express.json());
const uri = process.env.URI;
mongoose.connect(uri, {useNewUrlParser: true, useCreateIndex: true});
const connection = mongoose.connection;
connection.once('open', () => {
console.log("MongoDB database connection established")
})
const votesRouter = require('./routes/votes')
app.use('/votes', votesRouter);
require('dotenv').config();
app.get('/', (req, res) => res.send('hello world'));
app.use(handle.notFound);
app.use(handle.errors);
app.listen(port, console.log(`Server running on port ${port}`));
Add && to your server script
"server": "cd src/server && nodemon index.js"
That is not mongoDB.
It sounds like your two servers might be trying to run on the same port. What port do each of the servers run on?
What is in the server index.js? It is exiting with error code 0, which indicates no error exit.

'npm start' in node.js doesn't works

node App.js works, but npm start doesn't works.
I just followed this nodejs tutorial (tutorial is written by Korean).
I tried to change code to:
"scripts": {
"start": "webpack-dev-server"
}
but it didn't work.
this is my code:
App.js
const http = require('http');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World\n');
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
package.json
{
"name": "codlab-nodejs",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node js"
},
"author": "",
"license": "ISC"
}
package-lock.json
{
"name": "codlab-nodejs",
"version": "1.0.0",
"lockfileVersion": 1
}
This is the err msg.
C:\Users\김동희\codlab-nodejs>npm start
> codlab-nodejs#1.0.0 start C:\Users\김동희\codlab-nodejs
> node js
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'C:\Users\김동희\codlab-nodejs\js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! codlab-nodejs#1.0.0 start: `node js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the codlab-nodejs#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\김동희\AppData\Roaming\npm-cache\_logs\2019-08-03T14_03_42_211Z-debug.log
In your package.json change the value of the property "start".
Replace:
"start": "node js"
With:
"start": "node App.js"
The start npm script is trying to run a file called js, which does not exist and consequently fails.
Instead, set your start npm script to be the correct command that asks Node.js to run your App.js file.
Your package.json would include something like this:
"scripts": {
"start": "node App.js"
}

My node + express app deploys fine locally but will not deploy when pushed to heroku

first off my apologies if this is a basic solve. I'm new to Node + Express and still trying to grapple a few concepts!
I have a Node + Express app that starts locally but when I push to heroku or run heroku local web it exits with code 0 and produces no error code for me to diagnose.
Here is the specific output from the logs when I deploy to Heroku:
2018-06-30T11:58:37.052754+00:00 heroku[web.1]: Starting process with command `npm run build`
2018-06-30T11:58:39.336703+00:00 app[web.1]:
2018-06-30T11:58:39.336728+00:00 app[web.1]: > bookworm-api#1.0.0 build /app
2018-06-30T11:58:39.336733+00:00 app[web.1]: > npm run clean && npm run build-babel
2018-06-30T11:58:39.336734+00:00 app[web.1]:
2018-06-30T11:58:39.777160+00:00 app[web.1]:
2018-06-30T11:58:39.777199+00:00 app[web.1]: > bookworm-api#1.0.0 clean /app
2018-06-30T11:58:39.777201+00:00 app[web.1]: > rm -rf build && mkdir build
2018-06-30T11:58:39.777202+00:00 app[web.1]:
2018-06-30T11:58:40.305583+00:00 app[web.1]:
2018-06-30T11:58:40.305603+00:00 app[web.1]: > bookworm-api#1.0.0 build-babel /app
2018-06-30T11:58:40.305605+00:00 app[web.1]: > babel -d ./build ./src -s
2018-06-30T11:58:40.305610+00:00 app[web.1]:
2018-06-30T11:58:41.146122+00:00 app[web.1]: src/index.js -> build/index.js
2018-06-30T11:58:41.196474+00:00 app[web.1]: src/mailer.js -> build/mailer.js
2018-06-30T11:58:41.242714+00:00 app[web.1]: src/models/Circuit.js -> build/models/Circuit.js
2018-06-30T11:58:41.293304+00:00 app[web.1]: src/models/User.js -> build/models/User.js
2018-06-30T11:58:41.346985+00:00 app[web.1]: src/routes/auth.js -> build/routes/auth.js
2018-06-30T11:58:41.362022+00:00 app[web.1]: src/routes/circuits.js -> build/routes/circuits.js
2018-06-30T11:58:41.380720+00:00 app[web.1]: src/routes/stripe.js -> build/routes/stripe.js
2018-06-30T11:58:41.411474+00:00 app[web.1]: src/routes/users.js -> build/routes/users.js
2018-06-30T11:58:41.423692+00:00 app[web.1]: src/utils/parseErrors.js -> build/utils/parseErrors.js
2018-06-30T11:58:41.508066+00:00 heroku[web.1]: Process exited with status 0
2018-06-30T11:58:41.532442+00:00 heroku[web.1]: State changed from starting to crashed
Here is the output when I run Heroku local web
[OKAY] Loaded ENV .env File as KEY=VALUE Format
8:04:38 AM web.1 | > bookworm-api#1.0.0 build /Users/kylependergast/Desktop/projects/bookworm/bookworm-api
8:04:38 AM web.1 | > npm run clean && npm run build-babel
8:04:38 AM web.1 | > bookworm-api#1.0.0 clean /Users/kylependergast/Desktop/projects/bookworm/bookworm-api
8:04:38 AM web.1 | > rm -rf build && mkdir build
8:04:39 AM web.1 | > bookworm-api#1.0.0 build-babel /Users/kylependergast/Desktop/projects/bookworm/bookworm-api
8:04:39 AM web.1 | > babel -d ./build ./src -s
8:04:39 AM web.1 | src/index.js -> build/index.js
8:04:39 AM web.1 | src/mailer.js -> build/mailer.js
8:04:39 AM web.1 | src/models/Circuit.js -> build/models/Circuit.js
8:04:39 AM web.1 | src/models/User.js -> build/models/User.js
8:04:39 AM web.1 | src/routes/auth.js -> build/routes/auth.js
8:04:39 AM web.1 | src/routes/circuits.js -> build/routes/circuits.js
8:04:39 AM web.1 | src/routes/stripe.js -> build/routes/stripe.js
8:04:39 AM web.1 | src/routes/users.js -> build/routes/users.js
8:04:39 AM web.1 | src/utils/parseErrors.js -> build/utils/parseErrors.js
8:04:39 AM web.1 Exited Successfully
Here is my package.json file:
{
"name": "bookworm-api",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"test": "nodemon --exec babel-node -- src/index.js",
"clean": "rm -rf build && mkdir build",
"build-babel": "babel -d ./build ./src -s",
"build": "npm run clean && npm run build-babel",
"start": "npm run build && node ./build/index.js"
},
"engines": {
"node": "9.4.0"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-eslint": "^8.2.3",
"babel-preset-env": "^1.7.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-prettier": "^2.6.0",
"nodemon": "^1.17.4"
},
"dependencies": {
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"bcrypt": "^2.0.1",
"bluebird": "^3.5.1",
"body-parser": "^1.18.2",
"dotenv": "^5.0.1",
"express": "^4.16.3",
"jsonwebtoken": "^8.2.1",
"lodash": "^4.17.10",
"mongodb": "^3.1.0",
"mongoose": "^4.11.10",
"mongoose-unique-validator": "^2.0.1",
"nodemailer": "^4.6.4",
"request-promise": "^4.2.2",
"stripe": "^6.1.1",
"uuid": "^3.2.1",
"xml2js": "^0.4.19"
}
}
And here is my index.js file:
import express from 'express';
import path from 'path';
import mongoose from 'mongoose';
import bodyParser from 'body-parser';
import dotenv from 'dotenv';
import Promise from 'bluebird';
import auth from './routes/auth';
import users from './routes/users';
import circuits from "./routes/circuits";
import stripe from './routes/stripe';
dotenv.config();
const app = express();
app.use(bodyParser.json());
mongoose.Promise = Promise;
mongoose.connect(
process.env.MONGODB_URI || process.env.MONGODB_URL_DEV_LOCAL,
{useMongoClient: true});
app.use('/api/auth', auth);
app.use('/api/users', users);
app.use('/api/circuits', circuits);
app.use('/api/stripe', stripe);
app.post('/api/auth', (req, res) => {
res.status(400).json({ errors: {global: "Invalid Credentials" } });
});
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'index.html'));
})
var port = process.env.PORT || 8080
app.listen(port || 8080, function(){
console.log("App is running on port " + port);
});
Here is my Procfile
web: npm run build
I'm sure someone else has run into this issue but I've been unable to find resources that suggest what next steps to take. If you can point me to a relevant resource or provide the answer yourself it would be very much appreciated!
Your Procfile seems to be defined such that you're building stuff when starting the process. The build succeeds (returns 0), but then the process stops, which Heroku thinks is a bad condition, cause web servers shouldn't stop.
You need to actually run the web server in Heroku. Something like web: npm run start.
Though I would separate the build & run stages. You should do the build locally, or on a build machine (or a build service, such as Travis, Circle etc - they have Heroku integrations as well), and then push something compiled to Heroku. So Procfile could only be web: node ./build/index.js or something like that.

ExpressJS / Heroku Application Error

I am attempting to deploy a test express app on Heroku.
My package.json looks like this -
{
"name": "heroku-test-app",
"version": "1.0.0",
"description": "",
"main": "dist",
"scripts": {
"test": "cross-env NODE_ENV=test nodemon --exec mocha ./**/*.spec.js --compilers js:babel-core/register --require babel-polyfill",
"dev": "nodemon -w src --exec \"babel-node src --presets es2015,stage-0\"",
"build": "babel src -s -D -d dist --presets es2015,stage-0",
"start": "cross-env node dist",
"prestart": "npm run -s build",
"clean": "rimraf dist/"
},
"author": "",
"license": "ISC",
"dependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-eslint": "^7.2.3",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"body-parser": "^1.17.2",
"cross-env": "^5.0.5",
"dotenv": "^4.0.0",
"express": "^4.15.4",
"morgan": "^1.8.2"
},
"devDependencies": {
"chai": "^4.1.1",
"mocha": "^3.5.0",
"nodemon": "^1.11.0",
"rimraf": "^2.6.1",
"supertest": "^3.0.0"
}
}
My Procfile looks like this -
web: npm start
and my test app is as so -
import express from 'express';
import morgan from 'morgan';
import bodyParser from 'body-parser';
const app = express();
const postBodyLimit = '100kb';
const port = 3000;
app.use(
morgan('combined', {
skip: (req, res) => res.statusCode < 400
})
);
app.use(bodyParser.json({ limit: postBodyLimit }));
app.use(bodyParser.urlencoded({ extended: false }));
app.get('/', (req, res) => res.status(200).json({ message: 'No unicorns here.' }));
// catch 404's and pass to our global error handler
app.all('*', (req, res, next) => {
const err = new Error('Not Found');
err.status = 404;
next(err);
});
app.use((err, req, res, next) => {
res.status(err.status || 500).json({
message: err.message,
error: app.get('env') === 'development' ? err : null
});
});
app.listen(port, () => console.log(`listening on port ${port}`));
export default app;
When running my app locally, it starts and works perfectly. When running heroku local web, it also works as expected.
When I deploy to heroku however, I get the application error page. However on streaming my logs, there is nothing to suggest it has crashed.
I have just deployed again now, this is the current log file
2017-08-28T06:38:40.000000+00:00 app[api]: Build succeeded
2017-08-28T06:39:03.959631+00:00 app[web.1]:
2017-08-28T06:39:03.959649+00:00 app[web.1]: > heroic-test-app#1.0.0 prestart /app
2017-08-28T06:39:03.959650+00:00 app[web.1]: > npm run -s build
2017-08-28T06:39:03.959651+00:00 app[web.1]:
2017-08-28T06:39:05.856118+00:00 app[web.1]: src/index.js -> dist/index.js
2017-08-28T06:39:05.898228+00:00 app[web.1]:
2017-08-28T06:39:05.898232+00:00 app[web.1]: > heroic-test-app#1.0.0 start /app
2017-08-28T06:39:05.898234+00:00 app[web.1]: > cross-env node dist
2017-08-28T06:39:05.898234+00:00 app[web.1]:
2017-08-28T06:39:06.654100+00:00 app[web.1]: listening on port 3000
2017-08-28T06:44:40.078283+00:00 app[web.1]:
2017-08-28T06:44:40.078319+00:00 app[web.1]: > heroic-test-app#1.0.0 prestart /app
2017-08-28T06:44:40.078320+00:00 app[web.1]: > npm run -s build
2017-08-28T06:44:40.078321+00:00 app[web.1]:
2017-08-28T06:44:42.379605+00:00 app[web.1]: src/index.js -> dist/index.js
2017-08-28T06:44:42.434704+00:00 app[web.1]:
2017-08-28T06:44:42.434707+00:00 app[web.1]: > heroic-test-app#1.0.0 start /app
2017-08-28T06:44:42.434708+00:00 app[web.1]: > cross-env node dist
2017-08-28T06:44:42.434709+00:00 app[web.1]:
2017-08-28T06:44:43.156940+00:00 app[web.1]: listening on port 3000
2017-08-28T06:45:39.332668+00:00 app[web.1]: Error waiting for process to terminate: No child processes
I am at a loss how to proceed at this point.
you shouldn't set the port of http server as 3000, you should use the port of process.env, heroku will set an PORT in process.env.
So you should use app.listen(process.env.PORT, () => {}).
and there is an err code about the heroku application, if you can provide that, it would be better.

Resources