Closed ShintaroNippon closed 5 years ago
currently im getting this...
https://test.herokuapp.com/_next/static/VprFLaLvekNmzlVsEkO_S/pages/index.js and it shows a loading of page... and doesnt show the index
i had var port = process.env.PORT || 3000; "start": "npm run build && env NODE_ENV=production node app.js -p $PORT ",
<script src="/_next/static/runtime/main-0659896f75e70f677900.js"
i ran
npm run start
next-express-bootstrap-boilerplate@0.1.1 start /Users/carlosmanuelmouravieira/Desktop/projects/frontend/learn npm run build && env NODE_ENV=production node app.js -p $PORT
next-express-bootstrap-boilerplate@0.1.1 build /Users/carlosmanuelmouravieira/Desktop/projects/frontend/learn cd app && next build
Creating an optimized production build ...
Using external babel configuration Location: "/Users/carlosmanuelmouravieira/Desktop/projects/frontend/learn/app/.babelrc" Compiled successfully.
┌ /_app ├ /_document ├ /_error ├ /box/main ├ /box/suggestions ├ /dashboard/dashboard ├ /employee/login ├ /employee/main ├ /getPageContext ├ /ideas/main ├ /ideas/suggestions ├ /index ├ /index.1 ├ /index/data ├ /main/main └ /post
Hi @ShintaroNippon!
For now, I can recommend one change. The start script probably doesn't need to have the npm run build
part. You can remove it and then try again as Heroku will run the build
by itself. The loading page could be due to the fact that your app doesn't bind to the PORT
in time. (Heroku has a timeout if your app doesn't start within a few seconds of calling npm start
and the build step might cause it not to)
So the only two changes you need to do is remove the build
step inside the start
script and as you have correctly done write start(process.env.PORT || 9001);
instead of start(9001);
.
Feel free to close the issue if you're satisfied.
Sorry a late answer, I already could deploy to heroku, many thanks...
But now I'm facing this issue
> next-express-bootstrap-boilerplate@0.1.1 dev /home/shintaro/Desktop/projects/github/frontend
> nodemon app.js
[nodemon] 1.19.0
[nodemon] reading config ./nodemon.json
[nodemon] to restart at any time, enter `rs`
[nodemon] or send SIGHUP to 20111 to restart
[nodemon] ignoring: ./node_modules/**/* ./.next/**/* ./app/**/*
[nodemon] watching: app.js
[nodemon] watching extensions: js,json
[nodemon] starting `node app.js`
[nodemon] forking
[nodemon] child pid: 20124
[nodemon] watching 1 file
Compiling ...
but when I made localhost:3000 - my port
it doesn't loads
I have updated nodemon and created thid nodemon .json
{
"verbose": true,
"ignore": ["node_modules", ".next","app/"],
"watch": ["app.js"],
"ext": "js json"
}
in package.json I have this
"dev": "nodemon -w app.js app.js"
Could you help me please...
Thanks Carlos Vieira
Hi there I'm trying to deploy to an heroku app but it goes an error on node app.js
can you help me please?
i have tried too "start": "next start -p $PORT",