This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-15
Channels
- # announcements (13)
- # beginners (106)
- # cider (70)
- # cljdoc (1)
- # cljsjs (1)
- # clojure (97)
- # clojure-finland (1)
- # clojure-italy (13)
- # clojure-mexico (16)
- # clojure-russia (1)
- # clojure-spec (53)
- # clojure-uk (146)
- # clojurescript (44)
- # core-async (5)
- # cryogen (1)
- # css (1)
- # cursive (11)
- # datomic (89)
- # duct (10)
- # emacs (4)
- # figwheel-main (58)
- # fulcro (5)
- # hispano (35)
- # hyperfiddle (1)
- # jobs (2)
- # jobs-discuss (1)
- # lambdaisland (1)
- # leiningen (3)
- # off-topic (13)
- # onyx (50)
- # parinfer (3)
- # pedestal (4)
- # reagent (9)
- # ring-swagger (56)
- # rum (3)
- # shadow-cljs (85)
- # spacemacs (4)
- # vim (4)
i’m using shadow-cljs from lein and when i do lein ubjerjar
i get this
[2018-08-15 02:23:56.368 - INFO] duplicate resource cljs/compiler.cljc on classpath, using jar:file:/home/ec2-user/.m2/repository/org/clojure/clojurescript/1.10.339/clojurescript-1.10.339-slim.jar!/cljs/compiler.cljc over jar:file:/home/ec2-user/.m2/repository/org/clojure/clojurescript/1.9.946/clojurescript-1.9.946.jar!/cljs/compiler.cljc
but i made sure both package.json
and project.clj
have the same version of shadow-cljs
, 2.5.1@currentoor also why are you creating an uberjar with your clojurescript dependencies in it?
@lilactown i don’t have clojurescript in project.clj
deps
because in :uberjar :preptasks
i have
:prep-tasks ["clean" ["clean"]
"compile" ["with-profile" "cljs" "run" "-m" "shadow.cljs.devtools.cli" "release"
"main" "pos" "signon"]]}
is that a bad thing to do?
can you do a lein deps :tree
and see if there’s duplicate CLJS being pulled in somewhere?
@richiardiandrea the reload-deps!
still doesnt quite work. need to find a better strategy for dealing with conflicts and actually making the added sources available to compilation. right now they are just added to the classpath and would require reloading the server first. I'll write an official introduction once I sorted out the kinks.
@currentoor you don't need to include anything from CLJS for a CLJ uberjar? in fact you want to avoid that to make it smaller. not sure how you end up with 2 versions of cljs on the classpath though.
it happens even if i do shadow release main
instead of via uberjar prep task
and it only happens on the latest version of shadow-cljs
i’ll see if it can happen in a minimal repo
@U05224H0W so i was able to reproduce the issue in a minimal repo
this is the bare bones lein fulcro template, except i bumped shadow-cljs in package.json
and project.clj
i logged what i saw in the readme
it does ultimately compile correctly but it still worries me that there are two versions of the compiler hanging around
@U0CKQ19AQ wrote the template used for this example, maybe he has an insight?
nothing looks suspect to me
Also I don’t see the warnings when running shadow-cljs in dev mode
My only insight would be that when you bump versions of things it changes the dep graph, and that could pull crap in differently and cause all manner of issues.
Compare a lein deps :tree
on the working vs non-working @currentoor
I switched to using org.clojure/clojurescript "1.10.339" :classifier "slim"
since the default release includes AOT classes which where clashing with shadow-cljs AOT classes
yeah confirmed. tools.deps
does the thing I expected but lein
does not which l leads to the duplicated dep
what version of lein?
i’ll try updating lein
, see if the latest version has this problem
damn i’m already at the latest
is it just an annoying warning for now, or could it actually cause problems in the build?
thanks for being so helpful, as usual!
what is the default directory that the SSL server serves? is it configurable?
thank you mr
10:14:27.602 [main] DEBUG io.undertow - JDK9 ALPN not supported
java.lang.NoSuchMethodException: javax.net.ssl.SSLParameters.setApplicationProtocols([Ljava.lang.String;)
at java.lang.Class.getMethod(Class.java:1786)
at io.undertow.protocols.alpn.JDK9AlpnProvider$1.run(JDK9AlpnProvider.java:47)
at io.undertow.protocols.alpn.JDK9AlpnProvider$1.run(JDK9AlpnProvider.java:43)
at java.security.AccessController.doPrivileged(Native Method)
is this expected? i’m thinking it could do with dependency mismatchesokay will do
I am getting a weird
Circular dependency detected: testing.cljs.spec -> testing.cljs.spec
(require 'testing.cljs.spec :reload)
when I do (require 'testing.cljs.spec :reload)
and it looks like after that someting is messed up:
Circular dependency detected: testing.cljs.spec -> testing.cljs.spec
ClassCastException:
the parent of that one
a dependent
I mean A requires B, I was in A
yep, but I am now noticing that (unfortunately) it does not happen every time
will try to repro it consistently
I also see a
ClassCastException: clojure.lang.PersistentHashSet cannot be cast to clojure.lang.Associative
clojure.lang.RT.assoc (RT.java:820)
clojure.core/assoc--5218 (core.clj:191)
clojure.core/assoc--5218 (core.clj:190)
clojure.core/update (core.clj:6135)
clojure.core/update (core.clj:6123)
shadow.build.ns-form/eval10706/fn--10708 (ns_form.clj:372)
clojure.lang.MultiFn.invoke (MultiFn.java:234)
clojure.lang.PersistentVector.reduce (PersistentVector.java:343)
clojure.core/reduce (core.clj:6762)
clojure.core/reduce (core.clj:6745)
shadow.build.ns-form/parse (ns_form.clj:483)
shadow.build.ns-form/parse (ns_form.clj:450)
shadow.cljs.repl/make-repl-resource (repl.clj:76)
shadow.cljs.repl/make-repl-resource (repl.clj:60)
shadow.cljs.repl/repl-ns (repl.clj:304)
shadow.cljs.repl/repl-ns (repl.clj:302)
shadow.cljs.repl/process-read-result (repl.clj:415)
shadow.cljs.repl/process-read-result (repl.clj:395)
shadow.cljs.devtools.server.worker.impl/eval17297/fn--17300 (impl.clj:491)
clojure.lang.MultiFn.invoke (MultiFn.java:234)
shadow.cljs.devtools.server.util/server-thread/fn--17044/fn--17045/fn--17053 (util.clj:265)
shadow.cljs.devtools.server.util/server-thread/fn--17044/fn--17045 (util.clj:264)
shadow.cljs.devtools.server.util/server-thread/fn--17044 (util.clj:237)
java.lang.Thread.run (Thread.java:748)
now after REPL rebootit was not showing up before
oh right, let me get rid of the namespaces line by line
I need more overall details. just a random stacktrace doesn't give me anything to go on. its equally important to know what you did to get there
yeah, well I am working on a macro in a .cljc
file...
so plenty of moving parts
how do you usually deal with exceptions like this? I see the issue is closed but of course the problem is still there 😄
just asking from a maintainer perspective
I asked for more info. you didn't provide any. I close it after a while since there is nothing I can do.
yep I saw that, just wondering whether it is best to leave open things like this, because other folks can pitch in...I maintain a couple of projects as well and wanted to ask your opinion 😄
dunno still figuring this out myself. Getting a report with a basically blank exception with no additional details and no further movement despite a "Will try to investigate more" might just mean that it never happened again
trying to repro, but cannot right now, will answer in that issue if I find anything more robust
ok cool yeah
yes that's for sure
woah really?
it looks like I had a compilation error in the macro file, that you can repro with
(defmacro a-macro
[]
(let []
`(println "test")))
and the second time around, I get the ClassCastException
I mean the second require around
[5:0]~shadow.user=> (shadow/browser-repl)
[:browser-repl] Configuring build.
[:browser-repl] Compiling ...
[:browser-repl] Build completed. (134 files, 1 compiled, 0 warnings, 0.52s)
[5:1]~cljs.user=> JS runtime connected.
[5:1]~cljs.user=> (ns foo.bar)
nil
[5:1]~foo.bar=> (require 'demo.browser :reload)
nil
[5:1]~foo.bar=> (ns foo.bar (:require demo.browser))
[:result {:type :repl/error, :ex #error {
:cause "clojure.lang.PersistentHashSet cannot be cast to clojure.lang.Associative"
:via
[{:type java.lang.ClassCastException
:message "clojure.lang.PersistentHashSet cannot be cast to clojure.lang.Associative"
:at [clojure.lang.RT assoc "RT.java" 820]}]
:trace
[[clojure.lang.RT assoc "RT.java" 820]
[clojure.core$assoc__5138 invokeStatic "core.clj" 191]
[clojure.core$assoc__5138 invoke "core.clj" 190]
[clojure.core$update invokeStatic "core.clj" 6120]
[clojure.core$update invoke "core.clj" 6108]
[shadow.build.ns_form$fn__13691 invokeStatic "ns_form.clj" 372]
[shadow.build.ns_form$fn__13691 invoke "ns_form.clj" 368]
[clojure.lang.MultiFn invoke "MultiFn.java" 233]
[clojure.lang.PersistentVector reduce "PersistentVector.java" 341]
[clojure.core$reduce invokeStatic "core.clj" 6747]
[clojure.core$reduce invoke "core.clj" 6730]
[shadow.build.ns_form$parse invokeStatic "ns_form.clj" 483]
[shadow.build.ns_form$parse invoke "ns_form.clj" 450]
[shadow.cljs.repl$make_repl_resource invokeStatic "repl.clj" 76]
[shadow.cljs.repl$make_repl_resource invoke "repl.clj" 60]
[shadow.cljs.repl$repl_ns invokeStatic "repl.clj" 304]
[shadow.cljs.repl$repl_ns invoke "repl.clj" 302]
[shadow.cljs.repl$process_read_result invokeStatic "repl.clj" 415]
[shadow.cljs.repl$process_read_result invoke "repl.clj" 395]
[shadow.cljs.devtools.server.worker.impl$fn__19853 invokeStatic "impl.clj" 491]
[shadow.cljs.devtools.server.worker.impl$fn__19853 invoke "impl.clj" 455]
[clojure.lang.MultiFn invoke "MultiFn.java" 233]
[shadow.cljs.devtools.server.util$server_thread$fn__19628$fn__19629$fn__19637 invoke "util.clj" 265]
[shadow.cljs.devtools.server.util$server_thread$fn__19628$fn__19629 invoke "util.clj" 264]
[shadow.cljs.devtools.server.util$server_thread$fn__19628 invoke "util.clj" 237]
[clojure.lang.AFn run "AFn.java" 22]
[java.lang.Thread run "Thread.java" 844]]}}]
seems similar 😄
:reload
handling is completely weird. don't know how I intended that to work in the first place 😛
well I have just introduced that key binding in cider
so I guess nobody was really using it 😛
oh ok good then