magomimmo / modern-cljs

A series of tutorials on ClojureScript
2.92k stars 288 forks source link

Boot: No such task (reload) #370

Open Jobava opened 8 years ago

Jobava commented 8 years ago

Following the tutorial at this stage: https://github.com/magomimmo/modern-cljs/blob/master/doc/second-edition/tutorial-02.md

I get the error:

boot serve -d target watch reload cljs-repl cljs target -d target

             clojure.lang.ExceptionInfo: java.lang.IllegalArgumentException: No such task (reload)

    data: {:file "/tmp/boot.user8130808964499982385.clj", :line 11}

java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: No such task (reload)

     java.lang.IllegalArgumentException: No such task (reload)

          boot.core/construct-tasks  core.clj:  754

                            ...                

             clojure.core/apply  core.clj:  630
                  boot.core/boot/fn  core.clj:  805
    clojure.core/binding-conveyor-fn/fn  core.clj: 1916

my core.cljs file is now:

(set-env!

 :source-paths #{"src/cljs"}

 :resource-paths #{"html"}

 :dependencies '[

                 [org.clojure/clojure "1.7.0"]

                 [org.clojure/clojurescript "1.7.170"]

                 [adzerk/boot-cljs "1.7.170-3"]

                 [pandeiro/boot-http "0.7.0"]

                 [adzerk/boot-reload "0.4.2"]

                 [adzerk/boot-cljs-repl "0.3.0"]

                 [com.cemerick/piggieback "0.2.1"]     ;; needed by bREPL 

                 [weasel "0.7.0"]                      ;; needed by bREPL

                 [org.clojure/tools.nrepl "0.2.12"]    ;; needed by bREPL

                 ])

(require '[adzerk.boot-cljs :refer [cljs]]

         '[pandeiro.boot-http :refer [serve]]

         '[adzerk.boot-reload :refer [reload]]

         '[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]])
rcagantas commented 7 years ago

I managed to solve this by re-ordering the tasks.

boot serve -d target watch cljs target -d target reload

magomimmo commented 7 years ago

@rcagantas thanks. I suspect that both of you are using a recent boot version. Currently, the modern-cljs series is pinned to the 2.5.5 one. Hopefully the next month I'll have the time to upgrade the series to the newly released boot version 2.7.1.

rcagantas commented 7 years ago

I am, at least. Thanks for the tutorial. I'm still working my way through the tutorial. There are several things that need to be updated as far as I remember.

  1. The section about BOOT_EMIT_TARGET=no might not be needed at all now.
  2. "boot cljs" asks to check the target directory but it isn't created at all unless you call "boot target" in the succeeding section. There's an existing PR for it.
  3. I suspect that "-d target" isn't needed at all by default and we can actually just call "boot serve watch cljs target"
magomimmo commented 7 years ago

yes, the very first 4 tutorials seem to need larger updates than all the following. If I remember well all the others should work with a more recent boot release (at lest with the 2.6.x release) . This is something that make me crazy, because semantic version should allow to run without problems any program based on minor versions with the same major version. Anyway, if you had the time watch the latest Rich's talk you know what I'm talking about. In a couple of weeks, I'll introduce cljs to few new entries in my company and it will be the opportunity to teach them how to upgrade the modern-cljs series to boot 2.7.1.

coetry commented 7 years ago

Any updates on this? I just recently ran into the same error:

https://gist.github.com/coetry/fe5debafa1934b213423f7eb068ba926