mohebifar / racket

A complete starting app for developing universal React/Redux web apps with generators, best practices and more
https://racket-demo.herokuapp.com/
MIT License
290 stars 14 forks source link

Heroku deploy example #13

Closed bogdansoare closed 8 years ago

bogdansoare commented 8 years ago

Hey, first of all thanks for this yeoman generator, it helps big time developing universal react apps.

Could you please provide some instructions on how you deployed the example app to Heroku. I've tried deploying to Heroku but I get an error at npm run build regarding not finding webpack. Thanks.

remote: -----> Building dependencies
remote:        Installing node modules (package.json)
remote:
remote:        > vocea-media-fe@1.0.0 postinstall /tmp/build_5d938f69de6d3c3cbf4ad96f7559dbb3
remote:        > npm run build
remote:
remote:
remote:        > vocea-media-fe@1.0.0 build /tmp/build_5d938f69de6d3c3cbf4ad96f7559dbb3
remote:        > webpack --colors --config ./webpack/prod.config.js
remote:
remote:        sh: 1: webpack: not found
remote:
remote:        npm ERR! Linux 3.13.0-91-generic
remote:        npm ERR! argv "/tmp/build_5d938f69de6d3c3cbf4ad96f7559dbb3/.heroku/node/bin/node" "/tmp/build_5d938f69de6d3c3cbf4ad96f7559dbb3/.heroku/node/bin/npm" "run" "build"
remote:        npm ERR! node v4.1.1
remote:        npm ERR! npm  v3.9.0
remote:        npm ERR! file sh
remote:        npm ERR! code ELIFECYCLE
remote:        npm ERR! errno ENOENT
remote:        npm ERR! syscall spawn
remote:        npm ERR! vocea-media-fe@1.0.0 build: `webpack --colors --config ./webpack/prod.config.js`
remote:        npm ERR! spawn ENOENT
remote:        npm ERR!
remote:        npm ERR! Failed at the vocea-media-fe@1.0.0 build script 'webpack --colors --config ./webpack/prod.config.js'.
mohebifar commented 8 years ago

Heroku ignores devDependencies. The trick is:

heroku config:set NPM_CONFIG_PRODUCTION=false
bogdansoare commented 8 years ago

Cool, thank you for the quick response.