magomimmo / modern-cljs

A series of tutorials on ClojureScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tutorial 1: boot cljs throws exception

webappzero opened this issue · comments

In Tutorial 1, at the first execution of boot cljs (line 199), the command throws the exception listed at the at the bottom of this Issue post.

I've corrected the issue by changing the value of :dependencies to:

:dependencies '[[adzerk/boot-cljs "2.1.1"]
                 [org.clojure/clojurescript "1.9.854"]]

A web search turned up others who bumped into the issue.

I'm not sure if my solution will cause problems with future tutorials in this series, but I will update this issue if so. Thank you for this helpful learning resource! : )

boot cljs
Retrieving boot-cljs-2.1.1.pom from https://repo.clojars.org/ (2k)
Retrieving boot-cljs-2.1.1.jar from https://repo.clojars.org/ (12k)
Writing main.cljs.edn...
Compiling ClojureScript...
• main.js
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: cljs.util, being replaced by: #'cljs.util/boolean?
                                       java.lang.Thread.run                  Thread.java:  745
         java.util.concurrent.ThreadPoolExecutor$Worker.run      ThreadPoolExecutor.java:  617
          java.util.concurrent.ThreadPoolExecutor.runWorker      ThreadPoolExecutor.java: 1142
                        java.util.concurrent.FutureTask.run              FutureTask.java:  266
                                                        ...                                   
                        clojure.core/binding-conveyor-fn/fn                     core.clj: 2027
                              adzerk.boot-cljs/compile-1/fn                boot_cljs.clj:  160
                                   adzerk.boot-cljs/compile                boot_cljs.clj:   67
                                          boot.pod/call-in*                      pod.clj:  413
                                                        ...                                   
org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke  ClojureRuntimeShimImpl.java:  102
org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke  ClojureRuntimeShimImpl.java:  109
                                                        ...                                   
                                          boot.pod/call-in*                      pod.clj:  410
                                      boot.pod/eval-fn-call                      pod.clj:  357
                                                        ...                                   
                                       clojure.core/require                     core.clj: 5911 (repeats 2 times)
                                         clojure.core/apply                     core.clj:  659
                                                        ...                                   
                                     clojure.core/load-libs                     core.clj: 5873
                                     clojure.core/load-libs                     core.clj: 5889
                                         clojure.core/apply                     core.clj:  659
                                                        ...                                   
                                      clojure.core/load-lib                     core.clj: 5832
                                      clojure.core/load-lib                     core.clj: 5851
                                   clojure.core/load-lib/fn                     core.clj: 5852
                                      clojure.core/load-one                     core.clj: 5812
                                                        ...                                   
                                          clojure.core/load                     core.clj: 5991
                                          clojure.core/load                     core.clj: 6007
                                       clojure.core/load/fn                     core.clj: 6008
                                                        ...                                   
                              adzerk.boot-cljs.impl/eval157                     impl.clj:    1
              adzerk.boot-cljs.impl/eval157/loading--auto--                     impl.clj:    1
                                                        ...                                   
                                       clojure.core/require                     core.clj: 5911 (repeats 2 times)
                                         clojure.core/apply                     core.clj:  659
                                                        ...                                   
                                     clojure.core/load-libs                     core.clj: 5873
                                     clojure.core/load-libs                     core.clj: 5889
                                         clojure.core/apply                     core.clj:  659
                                                        ...                                   
                                      clojure.core/load-lib                     core.clj: 5832
                                      clojure.core/load-lib                     core.clj: 5851
                                   clojure.core/load-lib/fn                     core.clj: 5852
                                      clojure.core/load-one                     core.clj: 5812
                                                        ...                                   
                                          clojure.core/load                     core.clj: 5991
                                          clojure.core/load                     core.clj: 6007
                                       clojure.core/load/fn                     core.clj: 6008
                                                        ...                                   
                                    cljs.build.api/eval2465                      api.clj:    8
                    cljs.build.api/eval2465/loading--auto--                      api.clj:    8
                                                        ...                                   
                                       clojure.core/require                     core.clj: 5911 (repeats 2 times)
                                         clojure.core/apply                     core.clj:  659
                                                        ...                                   
                                     clojure.core/load-libs                     core.clj: 5873
                                     clojure.core/load-libs                     core.clj: 5889
                                         clojure.core/apply                     core.clj:  659
                                                        ...                                   
                                      clojure.core/load-lib                     core.clj: 5832
                                      clojure.core/load-lib                     core.clj: 5851
                                   clojure.core/load-lib/fn                     core.clj: 5852
                                      clojure.core/load-one                     core.clj: 5812
                                                        ...                                   
                                          clojure.core/load                     core.clj: 5991
                                          clojure.core/load                     core.clj: 6007
                                       clojure.core/load/fn                     core.clj: 6008
                                                        ...                                   
                                     cljs.compiler/eval2471                compiler.cljc:    9
                     cljs.compiler/eval2471/loading--auto--                compiler.cljc:    9
                                                        ...                                   
                                       clojure.core/require                     core.clj: 5911 (repeats 2 times)
                                         clojure.core/apply                     core.clj:  659
                                                        ...                                   
                                     clojure.core/load-libs                     core.clj: 5873
                                     clojure.core/load-libs                     core.clj: 5889
                                         clojure.core/apply                     core.clj:  659
                                                        ...                                   
                                      clojure.core/load-lib                     core.clj: 5832
                                      clojure.core/load-lib                     core.clj: 5851
                                   clojure.core/load-lib/fn                     core.clj: 5852
                                      clojure.core/load-one                     core.clj: 5812
                                                        ...                                   
                                          clojure.core/load                     core.clj: 5991
                                          clojure.core/load                     core.clj: 6007
                                       clojure.core/load/fn                     core.clj: 6008
                                                        ...                                   
                                   cljs.source-map/eval2477               source_map.clj:    1
                   cljs.source-map/eval2477/loading--auto--               source_map.clj:    1
                                                        ...                                   
                                       clojure.core/require                     core.clj: 5911 (repeats 2 times)
                                         clojure.core/apply                     core.clj:  659
                                                        ...                                   
                                     clojure.core/load-libs                     core.clj: 5873
                                     clojure.core/load-libs                     core.clj: 5889
                                         clojure.core/apply                     core.clj:  659
                                                        ...                                   
                                      clojure.core/load-lib                     core.clj: 5832
                                      clojure.core/load-lib                     core.clj: 5851
                                   clojure.core/load-lib/fn                     core.clj: 5852
                                      clojure.core/load-one                     core.clj: 5812
                                                        ...                                   
                                          clojure.core/load                     core.clj: 5991
                                          clojure.core/load                     core.clj: 6007
                                       clojure.core/load/fn                     core.clj: 6008
                                                        ...                                   
                       clojure.spec.alpha/macroexpand-check                    alpha.clj:  696
                                       clojure.core/ex-info                     core.clj: 4725
             clojure.lang.ExceptionInfo: Call to clojure.core/ns did not conform to spec:
                                         In: [1] val: ((require [clojure.string :as string] [cljs.source-map.base64 :as base64])) fails at: [:args] predicate: (cat :docstring (? string?) :attr-map (? map?) :clauses :clojure.core.specs.alpha/ns-clauses),  Extra input
                                         :clojure.spec.alpha/spec  #object[clojure.spec.alpha$regex_spec_impl$reify__1200 0xaead83d "clojure.spec.alpha$regex_spec_impl$reify__1200@aead83d"]
                                         :clojure.spec.alpha/value  (cljs.source-map.base64-vlq (require [clojure.string :as string] [cljs.source-map.base64 :as base64]))
                                         :clojure.spec.alpha/args  (cljs.source-map.base64-vlq (require [clojure.string :as string] [cljs.source-map.base64 :as base64]))
                                         
    data: {#object[clojure.lang.Keyword 0x2f17e30d ":clojure.spec.alpha/problems"] [{#object[clojure.lang.Keyword 0x3e821657 ":path"] [#object[clojure.lang.Keyword 0x336ff18e ":args"]], #object[clojure.lang.Keyword 0x1d131e1b ":reason"] "Extra input", #object[clojure.lang.Keyword 0x71cf1b07 ":pred"] (#object[clojure.lang.Symbol 0x615091b8 "clojure.spec.alpha/cat"] #object[clojure.lang.Keyword 0x4fce136b ":docstring"] (#object[clojure.lang.Symbol 0x4aa83f4f "clojure.spec.alpha/?"] #object[clojure.lang.Symbol 0x43b6123e "clojure.core/string?"]) #object[clojure.lang.Keyword 0x260e86a1 ":attr-map"] (#object[clojure.lang.Symbol 0x19648c40 "clojure.spec.alpha/?"] #object[clojure.lang.Symbol 0x12bd8a64 "clojure.core/map?"]) #object[clojure.lang.Keyword 0x61e94def ":clauses"] #object[clojure.lang.Keyword 0x3300f4fd ":clojure.core.specs.alpha/ns-clauses"]), #object[clojure.lang.Keyword 0x1ce37e2d ":val"] ((#object[clojure.lang.Symbol 0xebb6851 "require"] [#object[clojure.lang.Symbol 0x70ab2d48 "clojure.string"] #object[clojure.lang.Keyword 0x3df26fe6 ":as"] #object[clojure.lang.Symbol 0x5b068087 "string"]] [#object[clojure.lang.Symbol 0x6f152006 "cljs.source-map.base64"] #object[clojure.lang.Keyword 0x3df26fe6 ":as"] #object[clojure.lang.Symbol 0x3a393455 "base64"]])), #object[clojure.lang.Keyword 0x13518f37 ":via"] [], #object[clojure.lang.Keyword 0x7cbc3762 ":in"] [1]}], #object[clojure.lang.Keyword 0x3a6f2de3 ":clojure.spec.alpha/spec"] #object[clojure.spec.alpha$regex_spec_impl$reify__1200 0xaead83d "clojure.spec.alpha$regex_spec_impl$reify__1200@aead83d"], #object[clojure.lang.Keyword 0x49872d67 ":clojure.spec.alpha/value"] (#object[clojure.lang.Symbol 0x56303b57 "cljs.source-map.base64-vlq"] (#object[clojure.lang.Symbol 0xebb6851 "require"] [#object[clojure.lang.Symbol 0x70ab2d48 "clojure.string"] #object[clojure.lang.Keyword 0x3df26fe6 ":as"] #object[clojure.lang.Symbol 0x5b068087 "string"]] [#object[clojure.lang.Symbol 0x6f152006 "cljs.source-map.base64"] #object[clojure.lang.Keyword 0x3df26fe6 ":as"] #object[clojure.lang.Symbol 0x3a393455 "base64"]])), #object[clojure.lang.Keyword 0x4b2a01d4 ":clojure.spec.alpha/args"] (#object[clojure.lang.Symbol 0x56303b57 "cljs.source-map.base64-vlq"] (#object[clojure.lang.Symbol 0xebb6851 "require"] [#object[clojure.lang.Symbol 0x70ab2d48 "clojure.string"] #object[clojure.lang.Keyword 0x3df26fe6 ":as"] #object[clojure.lang.Symbol 0x5b068087 "string"]] [#object[clojure.lang.Symbol 0x6f152006 "cljs.source-map.base64"] #object[clojure.lang.Keyword 0x3df26fe6 ":as"] #object[clojure.lang.Symbol 0x3a393455 "base64"]]))}
clojure.lang.Compiler$CompilerException: clojure.lang.ExceptionInfo: Call to clojure.core/ns did not conform to spec:
                                         In: [1] val: ((require [clojure.string :as string] [cljs.source-map.base64 :as base64])) fails at: [:args] predicate: (cat :docstring (? string?) :attr-map (? map?) :clauses :clojure.core.specs.alpha/ns-clauses),  Extra input
                                         :clojure.spec.alpha/spec  #object[clojure.spec.alpha$regex_spec_impl$reify__1200 0xaead83d "clojure.spec.alpha$regex_spec_impl$reify__1200@aead83d"]
                                         :clojure.spec.alpha/value  (cljs.source-map.base64-vlq (require [clojure.string :as string] [cljs.source-map.base64 :as base64]))
                                         :clojure.spec.alpha/args  (cljs.source-map.base64-vlq (require [clojure.string :as string] [cljs.source-map.base64 :as base64]))
                                          {:clojure.spec.alpha/problems [{:path [:args], :reason "Extra input", :pred (clojure.spec.alpha/cat :docstring (clojure.spec.alpha/? clojure.core/string?) :attr-map (clojure.spec.alpha/? clojure.core/map?) :clauses :clojure.core.specs.alpha/ns-clauses), :val ((require [clojure.string :as string] [cljs.source-map.base64 :as base64])), :via [], :in [1]}], :clojure.spec.alpha/spec #object[clojure.spec.alpha$regex_spec_impl$reify__1200 0xaead83d "clojure.spec.alpha$regex_spec_impl$reify__1200@aead83d"], :clojure.spec.alpha/value (cljs.source-map.base64-vlq (require [clojure.string :as string] [cljs.source-map.base64 :as base64])), :clojure.spec.alpha/args (cljs.source-map.base64-vlq (require [clojure.string :as string] [cljs.source-map.base64 :as base64]))}, compiling:(cljs/source_map/base64_vlq.clj:1:1)
             clojure.lang.ExceptionInfo: clojure.lang.ExceptionInfo: Call to clojure.core/ns did not conform to spec:
                                         In: [1] val: ((require [clojure.string :as string] [cljs.source-map.base64 :as base64])) fails at: [:args] predicate: (cat :docstring (? string?) :attr-map (? map?) :clauses :clojure.core.specs.alpha/ns-clauses),  Extra input
                                         :clojure.spec.alpha/spec  #object[clojure.spec.alpha$regex_spec_impl$reify__1200 0xaead83d "clojure.spec.alpha$regex_spec_impl$reify__1200@aead83d"]
                                         :clojure.spec.alpha/value  (cljs.source-map.base64-vlq (require [clojure.string :as string] [cljs.source-map.base64 :as base64]))
                                         :clojure.spec.alpha/args  (cljs.source-map.base64-vlq (require [clojure.string :as string] [cljs.source-map.base64 :as base64]))
                                          {:clojure.spec.alpha/problems [{:path [:args], :reason "Extra input", :pred (clojure.spec.alpha/cat :docstring (clojure.spec.alpha/? clojure.core/string?) :attr-map (clojure.spec.alpha/? clojure.core/map?) :clauses :clojure.core.specs.alpha/ns-clauses), :val ((require [clojure.string :as string] [cljs.source-map.base64 :as base64])), :via [], :in [1]}], :clojure.spec.alpha/spec #object[clojure.spec.alpha$regex_spec_impl$reify__1200 0xaead83d "clojure.spec.alpha$regex_spec_impl$reify__1200@aead83d"], :clojure.spec.alpha/value (cljs.source-map.base64-vlq (require [clojure.string :as string] [cljs.source-map.base64 :as base64])), :clojure.spec.alpha/args (cljs.source-map.base64-vlq (require [clojure.string :as string] [cljs.source-map.base64 :as base64]))}, compiling:(cljs/source_map/base64_vlq.clj:1:1)
    file: "/var/folders/hw/xn5ylm9s1f37k_l3wqc3stf00000gn/T/boot.user3653966628693007240.clj"
    line: 17

Hi,
I think the problem has to do with the version of clojure you are using.
Could you please provide the content of your boot.properties file? (if you don't have it already, you can create it by just typing boot -V > boot.properties in your terminal).
The tutorial assumes you have clojure 1.7.0 set in your boot.properties.

@webappzero thanks so much. @elenacanovi we should update boot-cljs everywhere in the series.

@elenacanovi Yes, this is probably related to my version of Clojure, which includes Spec. Here's the output boot -v :

BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.9.0-alpha17
BOOT_VERSION=2.7.1

I should have known better than to use a different version. Feel free to close this ticket when you like. My best : )

@webappzero ok, glad that it works. @magomimmo yes, we should update the series of tutorials to the most recent versions of clojure and boot-cljs.

@elenacanovi let's wait at least for the official release of boot-cljs. At the moment boot-cljs is a SNAPSHOT release and Clojure 1.9 is an alpha release.

While waiting for these updated releases, it might be helpful to alter Tutorial 1 to explicitly declare dependencies for both clj and cjls instead of relying on boot's automagic feature, as referrred to in the text of Tutorial 1 as:

Note that even if we did not include any clojure and clojurescript dependencies, boot will be able to automagically download the corresponding releases it knows to work well with it.

Not sure how this will affect future Tuts though. Just brainstorming.

Oh yeah! That might work then : )

BTW, I'm working through the tutorial with these new settings to see what bumps in the road I encounter. When I hit a bump I checkout version of your known good tutorial via git clone etc. to see if the problem is related to the changes in this issue.

I have found one such difference in Tutorial 4. When evaluating the l/validate-form function the expected return value isn't returned, but instead excludes the emitted js and only prints out:

#object[modern_cljs$login$validate_form]

instead of the expected:

#object[modern_cljs$login$validate_form "function modern_cljs$login$validate_form(){
var email = coument.getElementById("email");
var password = document.getElementById("password");
if(((cljs.core.count.call(null,email.value) > (0))) && ((cljs.core.count.call(null,password.value()) > (0)))){
return true;
} else {
alert("Please, complete the form!");

return false;
}
}"]

as show in Tutorial 4.

It may not be that helpful for to report these in a closed issue, or even at all, but I'm looking ahead to when these changes are made and how it might affect the correctness of the tutorials. I'm happy to cease and desist or adjust the strategy at your request. My best : )