While “git push heroku master” works, I'm getting a “Internal Server Error” loading the Heroku app
When I use git push heroku master, I get Everything up-to-date back in the terminal.
When I open the Heroku app with heroku open, I get the message "Internal Server Error" in the browser.
I can't find the cause. Can you? Thanks in advance!
Here's my index.js:
const express = require('express');
const bodyParser = require('body-parser');
const path = require('path');
const app = express();
var url = require('url')
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.get('*', (request, response) => {
response.sendFile(path.join(__dirname, 'client/build', 'index.js'));
});
if (process.env.NODE_ENV === 'production') {
app.use(express.static(path.join(__dirname, 'client/build')));
}
app.listen(process.env.PORT || 3000, () => console.log('Webhook server is listening, port 3000'));
... my package.json:
{
"name": "ratbot3",
"version": "1.0.0",
"description": "The bot for rat music lovers",
"engines": {
"node": "8.9.4"
},
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"repository": {
"type": "git",
"url": "ratbot3"
},
"keywords": [
"official",
"version",
"3.0"
],
"author": "David Nöldner",
"license": "ISC",
"dependencies": {
"body-parser": "^1.18.3",
"express": "^4.16.4"
},
"devDependencies": {
"babel-preset-env": "^1.7.0",
"babel-register": "^6.26.0"
}
}
and finally the logs:
2018-11-13T20:05:46.739893+00:00 app[web.1]: ReferenceError: path is not defined
2018-11-13T20:05:46.739918+00:00 app[web.1]: at app.get (/app/index.js:12:20)
2018-11-13T20:05:46.739922+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2018-11-13T20:05:46.739924+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/route.js:137:13)
2018-11-13T20:05:46.739925+00:00 app[web.1]: at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)
2018-11-13T20:05:46.739926+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2018-11-13T20:05:46.739929+00:00 app[web.1]: at /app/node_modules/express/lib/router/index.js:281:22
2018-11-13T20:05:46.739930+00:00 app[web.1]: at param (/app/node_modules/express/lib/router/index.js:354:14)
2018-11-13T20:05:46.739931+00:00 app[web.1]: at param (/app/node_modules/express/lib/router/index.js:365:14)
2018-11-13T20:05:46.739933+00:00 app[web.1]: at Function.process_params (/app/node_modules/express/lib/router/index.js:410:3)
2018-11-13T20:05:46.739934+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/index.js:275:10)
2018-11-13T20:05:48.326810+00:00 app[web.1]: ReferenceError: path is not defined
2018-11-13T20:05:48.326821+00:00 app[web.1]: at app.get (/app/index.js:12:20)
2018-11-13T20:05:48.326823+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2018-11-13T20:05:48.326825+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/route.js:137:13)
2018-11-13T20:05:48.326827+00:00 app[web.1]: at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)
2018-11-13T20:05:48.326828+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2018-11-13T20:05:48.326830+00:00 app[web.1]: at /app/node_modules/express/lib/router/index.js:281:22
2018-11-13T20:05:48.326831+00:00 app[web.1]: at param (/app/node_modules/express/lib/router/index.js:354:14)
2018-11-13T20:05:48.326833+00:00 app[web.1]: at param (/app/node_modules/express/lib/router/index.js:365:14)
2018-11-13T20:05:48.326834+00:00 app[web.1]: at Function.process_params (/app/node_modules/express/lib/router/index.js:410:3)
2018-11-13T20:05:48.326835+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/index.js:275:10)
2018-11-13T20:05:48.334309+00:00 heroku[router]: at=info method=GET path="/" host=ratatambot3.herokuapp.com request_id=f4a368ac-54fe-4bbd-b471-308ca34acadc fwd="109.90.232.252" dyno=web.1 connect=0ms service=5ms status=500 bytes=404 protocol=https
node.js git heroku
add a comment |
When I use git push heroku master, I get Everything up-to-date back in the terminal.
When I open the Heroku app with heroku open, I get the message "Internal Server Error" in the browser.
I can't find the cause. Can you? Thanks in advance!
Here's my index.js:
const express = require('express');
const bodyParser = require('body-parser');
const path = require('path');
const app = express();
var url = require('url')
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.get('*', (request, response) => {
response.sendFile(path.join(__dirname, 'client/build', 'index.js'));
});
if (process.env.NODE_ENV === 'production') {
app.use(express.static(path.join(__dirname, 'client/build')));
}
app.listen(process.env.PORT || 3000, () => console.log('Webhook server is listening, port 3000'));
... my package.json:
{
"name": "ratbot3",
"version": "1.0.0",
"description": "The bot for rat music lovers",
"engines": {
"node": "8.9.4"
},
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"repository": {
"type": "git",
"url": "ratbot3"
},
"keywords": [
"official",
"version",
"3.0"
],
"author": "David Nöldner",
"license": "ISC",
"dependencies": {
"body-parser": "^1.18.3",
"express": "^4.16.4"
},
"devDependencies": {
"babel-preset-env": "^1.7.0",
"babel-register": "^6.26.0"
}
}
and finally the logs:
2018-11-13T20:05:46.739893+00:00 app[web.1]: ReferenceError: path is not defined
2018-11-13T20:05:46.739918+00:00 app[web.1]: at app.get (/app/index.js:12:20)
2018-11-13T20:05:46.739922+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2018-11-13T20:05:46.739924+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/route.js:137:13)
2018-11-13T20:05:46.739925+00:00 app[web.1]: at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)
2018-11-13T20:05:46.739926+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2018-11-13T20:05:46.739929+00:00 app[web.1]: at /app/node_modules/express/lib/router/index.js:281:22
2018-11-13T20:05:46.739930+00:00 app[web.1]: at param (/app/node_modules/express/lib/router/index.js:354:14)
2018-11-13T20:05:46.739931+00:00 app[web.1]: at param (/app/node_modules/express/lib/router/index.js:365:14)
2018-11-13T20:05:46.739933+00:00 app[web.1]: at Function.process_params (/app/node_modules/express/lib/router/index.js:410:3)
2018-11-13T20:05:46.739934+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/index.js:275:10)
2018-11-13T20:05:48.326810+00:00 app[web.1]: ReferenceError: path is not defined
2018-11-13T20:05:48.326821+00:00 app[web.1]: at app.get (/app/index.js:12:20)
2018-11-13T20:05:48.326823+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2018-11-13T20:05:48.326825+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/route.js:137:13)
2018-11-13T20:05:48.326827+00:00 app[web.1]: at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)
2018-11-13T20:05:48.326828+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2018-11-13T20:05:48.326830+00:00 app[web.1]: at /app/node_modules/express/lib/router/index.js:281:22
2018-11-13T20:05:48.326831+00:00 app[web.1]: at param (/app/node_modules/express/lib/router/index.js:354:14)
2018-11-13T20:05:48.326833+00:00 app[web.1]: at param (/app/node_modules/express/lib/router/index.js:365:14)
2018-11-13T20:05:48.326834+00:00 app[web.1]: at Function.process_params (/app/node_modules/express/lib/router/index.js:410:3)
2018-11-13T20:05:48.326835+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/index.js:275:10)
2018-11-13T20:05:48.334309+00:00 heroku[router]: at=info method=GET path="/" host=ratatambot3.herokuapp.com request_id=f4a368ac-54fe-4bbd-b471-308ca34acadc fwd="109.90.232.252" dyno=web.1 connect=0ms service=5ms status=500 bytes=404 protocol=https
node.js git heroku
add a comment |
When I use git push heroku master, I get Everything up-to-date back in the terminal.
When I open the Heroku app with heroku open, I get the message "Internal Server Error" in the browser.
I can't find the cause. Can you? Thanks in advance!
Here's my index.js:
const express = require('express');
const bodyParser = require('body-parser');
const path = require('path');
const app = express();
var url = require('url')
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.get('*', (request, response) => {
response.sendFile(path.join(__dirname, 'client/build', 'index.js'));
});
if (process.env.NODE_ENV === 'production') {
app.use(express.static(path.join(__dirname, 'client/build')));
}
app.listen(process.env.PORT || 3000, () => console.log('Webhook server is listening, port 3000'));
... my package.json:
{
"name": "ratbot3",
"version": "1.0.0",
"description": "The bot for rat music lovers",
"engines": {
"node": "8.9.4"
},
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"repository": {
"type": "git",
"url": "ratbot3"
},
"keywords": [
"official",
"version",
"3.0"
],
"author": "David Nöldner",
"license": "ISC",
"dependencies": {
"body-parser": "^1.18.3",
"express": "^4.16.4"
},
"devDependencies": {
"babel-preset-env": "^1.7.0",
"babel-register": "^6.26.0"
}
}
and finally the logs:
2018-11-13T20:05:46.739893+00:00 app[web.1]: ReferenceError: path is not defined
2018-11-13T20:05:46.739918+00:00 app[web.1]: at app.get (/app/index.js:12:20)
2018-11-13T20:05:46.739922+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2018-11-13T20:05:46.739924+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/route.js:137:13)
2018-11-13T20:05:46.739925+00:00 app[web.1]: at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)
2018-11-13T20:05:46.739926+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2018-11-13T20:05:46.739929+00:00 app[web.1]: at /app/node_modules/express/lib/router/index.js:281:22
2018-11-13T20:05:46.739930+00:00 app[web.1]: at param (/app/node_modules/express/lib/router/index.js:354:14)
2018-11-13T20:05:46.739931+00:00 app[web.1]: at param (/app/node_modules/express/lib/router/index.js:365:14)
2018-11-13T20:05:46.739933+00:00 app[web.1]: at Function.process_params (/app/node_modules/express/lib/router/index.js:410:3)
2018-11-13T20:05:46.739934+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/index.js:275:10)
2018-11-13T20:05:48.326810+00:00 app[web.1]: ReferenceError: path is not defined
2018-11-13T20:05:48.326821+00:00 app[web.1]: at app.get (/app/index.js:12:20)
2018-11-13T20:05:48.326823+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2018-11-13T20:05:48.326825+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/route.js:137:13)
2018-11-13T20:05:48.326827+00:00 app[web.1]: at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)
2018-11-13T20:05:48.326828+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2018-11-13T20:05:48.326830+00:00 app[web.1]: at /app/node_modules/express/lib/router/index.js:281:22
2018-11-13T20:05:48.326831+00:00 app[web.1]: at param (/app/node_modules/express/lib/router/index.js:354:14)
2018-11-13T20:05:48.326833+00:00 app[web.1]: at param (/app/node_modules/express/lib/router/index.js:365:14)
2018-11-13T20:05:48.326834+00:00 app[web.1]: at Function.process_params (/app/node_modules/express/lib/router/index.js:410:3)
2018-11-13T20:05:48.326835+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/index.js:275:10)
2018-11-13T20:05:48.334309+00:00 heroku[router]: at=info method=GET path="/" host=ratatambot3.herokuapp.com request_id=f4a368ac-54fe-4bbd-b471-308ca34acadc fwd="109.90.232.252" dyno=web.1 connect=0ms service=5ms status=500 bytes=404 protocol=https
node.js git heroku
When I use git push heroku master, I get Everything up-to-date back in the terminal.
When I open the Heroku app with heroku open, I get the message "Internal Server Error" in the browser.
I can't find the cause. Can you? Thanks in advance!
Here's my index.js:
const express = require('express');
const bodyParser = require('body-parser');
const path = require('path');
const app = express();
var url = require('url')
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.get('*', (request, response) => {
response.sendFile(path.join(__dirname, 'client/build', 'index.js'));
});
if (process.env.NODE_ENV === 'production') {
app.use(express.static(path.join(__dirname, 'client/build')));
}
app.listen(process.env.PORT || 3000, () => console.log('Webhook server is listening, port 3000'));
... my package.json:
{
"name": "ratbot3",
"version": "1.0.0",
"description": "The bot for rat music lovers",
"engines": {
"node": "8.9.4"
},
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"repository": {
"type": "git",
"url": "ratbot3"
},
"keywords": [
"official",
"version",
"3.0"
],
"author": "David Nöldner",
"license": "ISC",
"dependencies": {
"body-parser": "^1.18.3",
"express": "^4.16.4"
},
"devDependencies": {
"babel-preset-env": "^1.7.0",
"babel-register": "^6.26.0"
}
}
and finally the logs:
2018-11-13T20:05:46.739893+00:00 app[web.1]: ReferenceError: path is not defined
2018-11-13T20:05:46.739918+00:00 app[web.1]: at app.get (/app/index.js:12:20)
2018-11-13T20:05:46.739922+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2018-11-13T20:05:46.739924+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/route.js:137:13)
2018-11-13T20:05:46.739925+00:00 app[web.1]: at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)
2018-11-13T20:05:46.739926+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2018-11-13T20:05:46.739929+00:00 app[web.1]: at /app/node_modules/express/lib/router/index.js:281:22
2018-11-13T20:05:46.739930+00:00 app[web.1]: at param (/app/node_modules/express/lib/router/index.js:354:14)
2018-11-13T20:05:46.739931+00:00 app[web.1]: at param (/app/node_modules/express/lib/router/index.js:365:14)
2018-11-13T20:05:46.739933+00:00 app[web.1]: at Function.process_params (/app/node_modules/express/lib/router/index.js:410:3)
2018-11-13T20:05:46.739934+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/index.js:275:10)
2018-11-13T20:05:48.326810+00:00 app[web.1]: ReferenceError: path is not defined
2018-11-13T20:05:48.326821+00:00 app[web.1]: at app.get (/app/index.js:12:20)
2018-11-13T20:05:48.326823+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2018-11-13T20:05:48.326825+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/route.js:137:13)
2018-11-13T20:05:48.326827+00:00 app[web.1]: at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)
2018-11-13T20:05:48.326828+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2018-11-13T20:05:48.326830+00:00 app[web.1]: at /app/node_modules/express/lib/router/index.js:281:22
2018-11-13T20:05:48.326831+00:00 app[web.1]: at param (/app/node_modules/express/lib/router/index.js:354:14)
2018-11-13T20:05:48.326833+00:00 app[web.1]: at param (/app/node_modules/express/lib/router/index.js:365:14)
2018-11-13T20:05:48.326834+00:00 app[web.1]: at Function.process_params (/app/node_modules/express/lib/router/index.js:410:3)
2018-11-13T20:05:48.326835+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/index.js:275:10)
2018-11-13T20:05:48.334309+00:00 heroku[router]: at=info method=GET path="/" host=ratatambot3.herokuapp.com request_id=f4a368ac-54fe-4bbd-b471-308ca34acadc fwd="109.90.232.252" dyno=web.1 connect=0ms service=5ms status=500 bytes=404 protocol=https
node.js git heroku
node.js git heroku
edited Nov 15 '18 at 12:25
Damien MATHIEU
23.7k126485
23.7k126485
asked Nov 15 '18 at 10:57
mandaleybromandaleybro
1116
1116
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53317919%2fwhile-git-push-heroku-master-works-im-getting-a-internal-server-error-load%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53317919%2fwhile-git-push-heroku-master-works-im-getting-a-internal-server-error-load%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown