gjaldon/heroku-buildpack-phoenix-static

Both mix and bower are reported missing

Closed this issue · 5 comments

remote:        Installing and caching bower components
remote: /tmp/buildpack_ad5f44cd6c8fb01d0c454ac5859d228b/lib/build.sh: line 70: bower: command not found
remote: cp: cannot stat ‘bower_components’: No such file or directory
remote:        Running default compile
remote:               Building Phoenix static assets
remote:        [BABEL] Note: The code generator has deoptimised the styling of "bower_components/angular/angular.js" as it exceeds the max of "100KB".
remote:        [BABEL] Note: The code generator has deoptimised the styling of "bower_components/jquery/dist/jquery.js" as it exceeds the max of "100KB".
remote:        [BABEL] Note: The code generator has deoptimised the styling of "bower_components/angular-bootstrap/ui-bootstrap-tpls.js" as it exceeds the max of "100KB".
remote:        07 Jul 04:43:16 - info: compiled 8 files into 2 files in 27408ms
remote:        /tmp/buildpack_ad5f44cd6c8fb01d0c454ac5859d228b/compile: line 3: mix: command not found
remote:
remote: -----> Finalizing build
remote:        Creating runtime environment
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:
remote: -----> Compressing... done, 21.7MB
remote: -----> Launching... done, v11

Was missing heroku buildpacks:add --index 1 https://github.com/HashNuke/heroku-buildpack-elixir

👍

Does bower need to be in your npm dependencies for this to work? I'm still seeing the same issue:

 npm WARN package.json @ No README data�[K
remote:        npm WARN package.json @ No license field.�[K
remote:        Installing and caching bower components�[K
remote: /tmp/buildpack20151029-162-1vgk1yq/lib/build.sh: line 70: bower: command not found�[K
remote: cp: cannot stat ‘bower_components’: No such file or directory�[K
remote:        Running default compile�[K
remote:        29 Oct 23:43:51 - error: { [Error: Component must have "/tmp/build_f750fe919c22bac2929fc26ec9db2670/bower_components/react/bower.json"] code: 'NO_BOWER_JSON' }�[K
remote:        29 Oct 23:43:54 - info: compiled 5 files into 2 files, copied 3 in 2774ms�[K
remote:        Check your digested files at "priv/static"�[K

@danielberkompas how this works is it checks if a bower.json file exists in your repo's root directory. If there is a bower.json, it will attempt to do bower install. bower install will only work if it was installed via npm.

So yes, you will need to add bower as one of of your npm dependencies. I could probably have it auto-install bower if it detects a bower.json file. But it's also nice to explicitly set it as a dep in npm. What do you think?

It makes sense. Added it to my devDependencies, and the buildpack works fine.