boot-clj / boot-figreload

Boot task providing live-reload using Fighweel client
Eclipse Public License 1.0
49 stars 1 forks source link

Assert failure on incremental build. #7

Closed currentoor closed 7 years ago

currentoor commented 7 years ago

I'm invoking the reload task like so.

(reload :asset-path "/public"
           :port 33887
           :ws-host   "localhost"
           :on-jsload 'arc.combined/run
           :client-opts {:debug true})

Initial compile seems to work fine, but incremental builds result in this stack trace.

java.lang.AssertionError: Assert failed: The compiler options :asset-path cannot be nil. This might be a bug.
                          (:asset-path compile-opts)
powerlaces.boot-figreload.messages/file-map-matches?/invokeStatic                     messages.clj:   11
             powerlaces.boot-figreload.messages/file-map-matches?                     messages.clj:    9
                                          clojure.core/partial/fn                         core.clj: 2515
                                           clojure.core/filter/fn                         core.clj: 2708
                                                              ...                                       
                                  clojure.core/first/invokeStatic                         core.clj:   55
                                               clojure.core/first                         core.clj:   55
           powerlaces.boot-figreload.messages/assign-cljs-opts/fn                     messages.clj:   24
                                             clojure.core/mapv/fn                         core.clj: 6627
                  clojure.core.protocols/iter-reduce/invokeStatic                    protocols.clj:   49
                           clojure.core.protocols/fn/invokeStatic                    protocols.clj:   75
                                        clojure.core.protocols/fn                    protocols.clj:   75
                                      clojure.core.protocols/fn/G                    protocols.clj:   13
                                 clojure.core/reduce/invokeStatic                         core.clj: 6545
                                   clojure.core/mapv/invokeStatic                         core.clj: 6618
                                                clojure.core/mapv                         core.clj: 6618
 powerlaces.boot-figreload.messages/assign-cljs-opts/invokeStatic                     messages.clj:   24
              powerlaces.boot-figreload.messages/assign-cljs-opts                     messages.clj:   15
                                          clojure.core/partial/fn                         core.clj: 2516
 powerlaces.boot-figreload.messages/changed-messages/invokeStatic                     messages.clj:   58
              powerlaces.boot-figreload.messages/changed-messages                     messages.clj:   51
      powerlaces.boot-figreload.server/send-changed!/invokeStatic                       server.clj:   60
                   powerlaces.boot-figreload.server/send-changed!                       server.clj:   53
arichiardi commented 7 years ago

Checking this today. One thing good for debugging, in case you want to help, is to launch boot with -v or even -vv` . I decided to be super verbose while developing this 😀

arichiardi commented 7 years ago

Ok asset-path is one of those things that don't have particular meaning anymore give the way boot-cljs compiles: we have potentially one .cljs.edn file per build and I am going to deprecate the option as it can be specified there.

arichiardi commented 7 years ago

More info on this in the upcoming docs in boot-cljs.

arichiardi commented 7 years ago

Pushed a version with the deprecated option:

https://clojars.org/powerlaces/boot-figreload

Some more explanation here: https://github.com/boot-clj/boot-figreload/commit/ea000aab35c6cae9f968e4bbeea4eca8e1d3c2c5

Let me know if you get it working!

currentoor commented 7 years ago

@arichiardi so I used the -vv flag and got this very verbose output.

https://gist.github.com/currentoor/45446c6d580414f2ee083fe6697d2d66

Unfortunately, I still get the same error.

arichiardi commented 7 years ago

Using the new version? 0.1.1-SNAPSHOT has deprecated that option so you should try to put it in your .cljs.edn files, see above for some context.

currentoor commented 7 years ago

Hey so I did like you said.

{:require  [arc.combined]
 :init-fns [arc.combined/run]
 :boot-reload {:on-jsload arc.combined/run}
 :compiler-options {:asset-path "/combined.out"}}
(deftask dev
  "Run a restartable system in the Repl"
  []
  (comp
   (environ :env dev-env)
   (migrate)
   (watch :verbose true)
   (speak)
   (system :sys #'dev-system :auto true :files ["systems.clj"
                                                "api/handler.clj"
                                                "csv.clj"
                                                "pdf_kit.clj"
                                                "search.clj"
                                                "html/support.clj"
                                                "html/shared.clj"
                                                "html/report.clj"])
   (reload ;:asset-path "/public"
           :port 33887
           :ws-host   "localhost"
           ;; :on-jsload 'arc.combined/run
           )
   (sass)
   (autoprefixer :files ["app.css"]
                 :exec-path "./node_modules/postcss-cli/bin/postcss"
                 :browsers "last 2 versions")
   (sift :move {#"app.css" "public/app.css"})
   (cljs-repl)
   (cljs :source-map true
         :optimizations :none
         :ids #{"public/combined"}
         :compiler-options {:devcards             true
                            :optimizations        :none
                            ;; Note: This next option means you might not see
                            ;; compile errors in certain situations until full
                            ;; recompile. For example, deleting a function
                            ;; referred to in another file will not raise an
                            ;; error.
                            :recompile-dependents true
                            ;; Set the following options to true to debug
                            ;; performance of compilation.
                            :verbose              false
                            :compiler-stats       false
                            ;; Allows compile time removal of debugging cljs.
                            :closure-defines      {"goog.DEBUG" true}})))

But incremental builds still result in this

java.lang.AssertionError: Assert failed: The compiler options :asset-path cannot be nil. This might be a bug.
(:asset-path compile-opts)
    at powerlaces.boot_figreload.messages$file_map_matches_QMARK_.invokeStatic(messages.clj:11)
    at powerlaces.boot_figreload.messages$file_map_matches_QMARK_.invoke(messages.clj:9)
    at clojure.core$partial$fn__4759.invoke(core.clj:2515)
    at clojure.core$filter$fn__4812.invoke(core.clj:2708)
    at clojure.lang.LazySeq.sval(LazySeq.java:40)
    at clojure.lang.LazySeq.seq(LazySeq.java:49)
    at clojure.lang.LazySeq.first(LazySeq.java:71)
    at clojure.lang.RT.first(RT.java:667)
    at clojure.core$first__4339.invokeStatic(core.clj:55)
    at clojure.core$first__4339.invoke(core.clj:55)
    at powerlaces.boot_figreload.messages$assign_cljs_opts$fn__14515.invoke(messages.clj:24)
arichiardi commented 7 years ago

Found the problem in your log dump above. As it always happens, it's completely unrelated from what I wrote above (still something has been improved so thanks!). Fixing asap.

arichiardi commented 7 years ago

@currentoor Ok so it looks like your .cljs.edn for some reason doesn't get any meta from boot-cljs. Make sure you use the latest 2.0.0 there as well. In any case I sent a fix to clojars (0.1.1-SNAPSHOT -> boot-figreload-0.1.1-20170521.230833-2):

I recommend to do:

rm -Rv ~/.m2/repository/powerlaces/boot-figreload

For wiping up stuff first. If you still have the problem, attach another boot -vv dev pretty please :smile:

arichiardi commented 7 years ago

@currentoor update on this one?

arichiardi commented 7 years ago

Closing this because it seems gone, feel free to reopen if necessary.