gjaldon / heroku-buildpack-phoenix-static

A Heroku buildpack for building Phoenix's static assets
MIT License
229 stars 224 forks source link

Specifying node_version causes build to fail #46

Closed ntilwalli closed 7 years ago

ntilwalli commented 7 years ago

Hi. Thanks for providing this tool! When I tried specifying a node_version=6.9.1 in my phoenix_static_buildpack.config I consistently go errors like:

-----> Creating .profile.d with env vars
-----> Writing export for multi-buildpack support
-----> Phoenix app detected
-----> Loading configuration and environment
       Loading config...
       Will use the following versions:
       * Node 6.9.1
       Will export the following config vars:
       * Config vars DATABASE_URL
       * MIX_ENV=prod
-----> Installing binaries
       Downloading node 6.9.1
 !     Push rejected, failed to compile Phoenix app.
 !     Push failed

When I did not specify a node_version the build proceeded properly.

gjaldon commented 7 years ago

@ntilwalli I'll have to try this out later in my day to see if I can reproduce the error.

aaronjensen commented 7 years ago

@ntilwalli Try it again, I was able to successfully use 6.9.1

ntilwalli commented 7 years ago

@aaronjensen I tried again. Same error. This is what my config looks like:

node_version=6.9.1
npm_version=3.10.9
phoenix_relative_path=apps/candle

If I drop the node_version line it works fine

aaronjensen commented 7 years ago

You might try dropping the npm_version, I don't have that.

This is mine (I'm sure much of this is not relevant to your app):

clean_cache=false
compile="script/buildpack-compile-assets"
config_vars_to_export=(DATABASE_URL TRACKJS_APPLICATION TRACKJS_TOKEN)
node_version=6.9.1
phoenix_relative_path=.
remove_node=true
ntilwalli commented 7 years ago

@aaronjensen @gjaldon The key was adding the remove_node=true. After I did that it downloaded 6.9.1 properly and completed fine. That param does not seem to be documented in the README, it should be. What does it do? Does it remove the cached version of node? Anyway, thanks for the help. Much appreciated

aaronjensen commented 7 years ago

@ntilwalli remove_node isn't added yet. It's in this pull request: https://github.com/gjaldon/heroku-buildpack-phoenix-static/pull/36 which is not yet merged.

If adding it fixed the problem for you, it's probable that you just needed a change to the file or your problem was intermittent. I would guess you could remove it and be just fine.

If I'm mistaken, that's inexplicable, but sometimes computers are 😄

ntilwalli commented 7 years ago

@aaronjensen so odd. I removed the line and tried it again and it just worked. I can't explain it. Maybe there was some LF/CR issue I wasn't seeing. I hate bugs that fix themselves, cuz they can unfix themselves 😉 Hoping that doesn't happen here. Anyway, thanks.