Closed mattjstar closed 9 years ago
If you're deploying from a git repo, you need to
npm run build
git add -f webpack-stats.json
git add -f static/dist/*
...every time you deploy. See heroku
branch.
awesome that got me closer thanks!
Now I'm unfortunately getting this error:
2015-09-11T14:51:47.757938+00:00 app[web.1]: module.js:338
2015-09-11T14:51:47.757942+00:00 app[web.1]: throw err;
2015-09-11T14:51:47.757943+00:00 app[web.1]: ^
2015-09-11T14:51:47.757947+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:336:15)
2015-09-11T14:51:47.757945+00:00 app[web.1]: Error: Cannot find module 'containers'
2015-09-11T14:51:47.757953+00:00 app[web.1]: at Object.<anonymous> (/app/src/routes.js:2:35)
2015-09-11T14:51:47.757956+00:00 app[web.1]: at normalLoader (/app/node_modules/babel/node_modules/babel-core/lib/api/register/node.js:199:5)
2015-09-11T14:51:47.757950+00:00 app[web.1]: at Module.require (module.js:365:17)
2015-09-11T14:51:47.757949+00:00 app[web.1]: at Function.Module._load (module.js:278:25)
2015-09-11T14:51:47.757957+00:00 app[web.1]: at Object.require.extensions.(anonymous function) [as .js] (/app/node_modules/babel/node_modules/babel-core/lib/api/register/node.js:216:7)
2015-09-11T14:51:47.757959+00:00 app[web.1]: at Module.load (module.js:355:32)
2015-09-11T14:51:47.757960+00:00 app[web.1]: at Function.Module._load (module.js:310:12)
2015-09-11T14:51:47.757951+00:00 app[web.1]: at require (module.js:384:17)
2015-09-11T14:51:47.757954+00:00 app[web.1]: at Module._compile (module.js:460:26)
2015-09-11T14:51:48.875486+00:00 heroku[web.1]: State changed from starting to crashed
...which was fixed by being explicit with the location of that file, but I don't want to now have to do that with all my directory declarations.
I tried deploying your heroku branch and got the same error. Have you seen that before?
Hmmm.... I just pulled the current master into the heroku branch, and it seems to be working.
weird, still getting the error even on a brand new untouched heroku app pushing your new heroku branch and running the 3 commands (build) above. Do you have any configuration that I'm missing, buildpacks, etc?
My heroku config variables are:
NODE_ENV production
NODE_PATH ./src
I suspect the latter is what you're missing.
That did it, thanks so much for all your help!
:+1:
For future reference I don't know if you want to add this to the readme on the heroku branch, but it wasn't super clear how to deploy to heroku. I can put together a PR if you need:
Hey guys, do you know why I'm getting this?
2015-09-11T18:19:22.762207+00:00 heroku[web.1]: Starting process with command `npm start`
2015-09-11T18:19:25.022522+00:00 app[web.1]:
2015-09-11T18:19:25.022542+00:00 app[web.1]: > hub-client@1.0.0 start /app
2015-09-11T18:19:25.022544+00:00 app[web.1]: > node ./node_modules/better-npm-run start
2015-09-11T18:19:25.022545+00:00 app[web.1]:
2015-09-11T18:19:25.186908+00:00 app[web.1]: running better-npm-run in /app
2015-09-11T18:19:25.195291+00:00 app[web.1]: Executing script: start
2015-09-11T18:19:25.195295+00:00 app[web.1]:
2015-09-11T18:19:25.198024+00:00 app[web.1]: to be executed:PORT=8080 NODE_ENV=production NODE_PATH=./src node ./bin/server.js
2015-09-11T18:19:29.171393+00:00 app[web.1]: Warning: connect.session() MemoryStore is not
2015-09-11T18:19:29.171397+00:00 app[web.1]: designed for a production environment, as it will leak
2015-09-11T18:19:29.171399+00:00 app[web.1]: memory, and will not scale past a single process.
2015-09-11T18:19:31.226206+00:00 app[web.1]: [webpack-isomorphic-tools] [error] asset not found: ./node_modules/font-awesome/scss/font-awesome.scss
2015-09-11T18:19:31.224728+00:00 app[web.1]: [webpack-isomorphic-tools] [error] asset not found: ./app/styles/main.scss
2015-09-11T18:19:40.547357+00:00 app[web.1]: ==> ✅ Server is listening
2015-09-11T18:19:40.551921+00:00 app[web.1]: ----------
2015-09-11T18:19:40.551924+00:00 app[web.1]: ==> 💻 Open http://localhost:8080 in a browser to view the app.
2015-09-11T18:19:40.551704+00:00 app[web.1]: ==> 🌎 React Redux Example Production running on port 8080, API on port 3030
2015-09-11T18:20:23.072426+00:00 app[web.1]: Error waiting for process to terminate: No child processes
2015-09-11T18:20:23.037595+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2015-09-11T18:20:23.037595+00:00 heroku[web.1]: Stopping process with SIGKILL
2015-09-11T18:20:23.917009+00:00 heroku[web.1]: State changed from starting to crashed
2015-09-11T18:20:23.894423+00:00 heroku[web.1]: Process exited with status 22
If I'm not mistaken, Heroku doesn't allow you to choose the ports where you want to run your processes, does it?
Thanks!
Are you using a Procfile? If you look at the heroku branch to start up on the dyno he doesn't use npm start
he does the following in the Procfile, bypassing the port issue allowing it to use the port from the env in config.js
web: node ./bin/server
Thanks @mattjstar, it worked!
Note also that you may see the same error if you haven't done your npm build
step before running npm start
I tried to deploy a fork of the most recent master code to heroku and I'm getting the following error: