I'm having trouble getting clojurescript to compile with
lein-cljsbuild on heroku. It works locally through foreman and runs
fine on heroku other than the cljs compilation issue.
I've tried a few things. First of all, heroku doesn't put
:dev-dependencies on the classpath by default[1]. When I enable
LEIN_DEV, the :dev-dependencies are downloaded, but the app times out
while booting[2]. If I try moving lein-cljsbuild from :dev-depencies
to :plugins in my project.clj, heroku rejects my git push[3].
Anyone faring any better?
Thanks,
Tim
[1] app[web.1]: Warning: problem requiring leiningen.cljsbuild hook:
Could not locate leiningen/cljsbuild__init.class or
leiningen/cljsbuild.clj on classpath
[2] heroku config:add LEIN_DEV=y
...
heroku[web.1]: Starting process with command `lein run -m tl.core`
app[web.1]: Compiling ClojureScript.
... (downloads lots of dependencies. can't finish before timing out?) ...
heroku[web.1]: Error R10 (Boot timeout) -> Web process failed
to bind to $PORT within 60 seconds of launch
[3] heroku config:remove LEIN_DEV
...
Copying 4 files to /tmp/build_c47l93hhsxf4/.lein-plugins
exec: 1: -client: not found
! Failed to install dependencies with Leiningen
! Heroku push rejected, failed to compile Clojure app
! [remote rejected] sessions -> master (pre-receive hook declined)
> I've tried a few things. First of all, heroku doesn't put
> :dev-dependencies on the classpath by default[1]. When I enable
> LEIN_DEV, the :dev-dependencies are downloaded, but the app times out
> while booting[2]. If I try moving lein-cljsbuild from :dev-depencies
> to :plugins in my project.clj, heroku rejects my git push[3].
It looks like there's a bug in the Heroku buildpack for Clojure where
JAVA_CMD isn't getting exported for when plugins are brought in. I've
pushed a fix and will deploy it soon, but in the mean time you can bring
it in with this command:
$ heroku config:add BUILDPACK_URL=git://github.com/heroku/heroku-buildpack-clojure.git
Thanks for catching this!
-Phil
Sorry, that wasn't too clear. Using :plugins is the correct approach here.
-Phil
Awesome, that works with the new buildpack. Thanks!
I also had to set up AOT compilation to avoid the boot timeout
mentioned in my original post.
$heroku config:add LEIN_BUILD_TASK="compile :all"
Thanks again,
Tim