This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-29
Channels
- # announcements (17)
- # aws (12)
- # babashka (27)
- # beginners (85)
- # bristol-clojurians (1)
- # calva (16)
- # cider (3)
- # clara (7)
- # clojure (80)
- # clojure-europe (13)
- # clojure-italy (19)
- # clojure-nl (2)
- # clojure-norway (6)
- # clojure-poland (1)
- # clojure-spec (31)
- # clojure-uk (61)
- # clojurescript (29)
- # core-async (10)
- # cursive (7)
- # data-science (1)
- # datomic (29)
- # docker (3)
- # fulcro (120)
- # graphql (16)
- # hugsql (2)
- # leiningen (17)
- # luminus (2)
- # off-topic (36)
- # other-languages (3)
- # pathom (13)
- # re-frame (12)
- # ring (2)
- # rum (1)
- # shadow-cljs (126)
- # tools-deps (56)
- # vscode (5)
I'm trying to add a simple ClojureScript test runner in my CircleCI build process - it works but I have to throw to get an exit code which circleci can see to abort the build process when my tests fail. Can someone suggest a better approach?
you could look into the malli build steps - itโs really well done, https://github.com/metosin/malli
Thanks, I'll check it out.
Here's what I've got:
Hi Guys ๐. I can't really wrap my head around how shadow-cljs handles dependencies. All I really want to do is use [this library](https://github.com/mrmcc3/tailwind-clj) in my project. How can I do that? I tried using deps.edn, but now I can't even start shadow-cljs at all with the following config: shadow-cljs.edn
{:deps true
:dev-http {8700 "target/"}
:builds {:app {:output-dir "target/js"
:asset-path "/js"
:target :browser
:build-hooks [(costa.utils.build/tailwind)]
:modules {:costa {:init-fn costa.main/main!}}
:devtools {:after-load costa.main/reload!}}}}
and deps.edn
{:paths ["src"]
:deps {thheller/shadow-cljs {:mvn/version <latest>}
mrmcc3/tailwind-clj {:git/url ""
:sha "67dc8999aef155dc197b4f207932b658e4496d39"}
re-frame {:mvn/version <latest>}}}
When I try run npx shadow-cljs -d cider/piggieback:0.4.1 -d cider/cider-nrepl:0.22.4 watch :app
I get the following error:
shadow-cljs - config: /app/shadow-cljs.edn cli version: 2.8.83 node: v10.16.3
shadow-cljs - starting via "clojure"
Error building classpath. class clojure.lang.Symbol cannot be cast to class java.lang.CharSequence (clojure.lang.Symbol is in unnamed module of loader 'app'; java.lang.CharSequence is in module java.base of loader 'bootstrap')
java.lang.ClassCastException: class clojure.lang.Symbol cannot be cast to class java.lang.CharSequence (clojure.lang.Symbol is in unnamed module of loader 'app'; java.lang.CharSequence is in module java.base of loader 'bootstrap')
at clojure.core$re_matcher.invokeStatic(core.clj:4849)
at clojure.core$re_find.invokeStatic(core.clj:4898)
at clojure.core$re_find.invoke(core.clj:4898)
at clojure.tools.deps.alpha.util.maven$version_range_QMARK_.invokeStatic(maven.clj:241)
at clojure.tools.deps.alpha.util.maven$version_range_QMARK_.invoke(maven.clj:239)
at clojure.tools.deps.alpha.extensions.maven$eval730$fn__733.invoke(maven.clj:47)
at clojure.lang.MultiFn.invoke(MultiFn.java:239)
at clojure.tools.deps.alpha$canonicalize_deps$fn__1166.invoke(alpha.clj:68)
at clojure.core.protocols$iter_reduce.invokeStatic(protocols.clj:49)
at clojure.core.protocols$fn__8140.invokeStatic(protocols.clj:75)
at clojure.core.protocols$fn__8140.invoke(protocols.clj:75)
at clojure.core.protocols$fn__8088$G__8083__8101.invoke(protocols.clj:13)
at clojure.core$reduce.invokeStatic(core.clj:6828)
at clojure.core$reduce.invoke(core.clj:6810)
at clojure.tools.deps.alpha$canonicalize_deps.invokeStatic(alpha.clj:67)
at clojure.tools.deps.alpha$canonicalize_deps.invoke(alpha.clj:65)
at clojure.tools.deps.alpha$resolve_deps.invokeStatic(alpha.clj:235)
at clojure.tools.deps.alpha$resolve_deps.invoke(alpha.clj:216)
at clojure.tools.deps.alpha.script.make_classpath2$create_classpath.invokeStatic(make_classpath2.clj:56)
at clojure.tools.deps.alpha.script.make_classpath2$create_classpath.invoke(make_classpath2.clj:48)
at clojure.tools.deps.alpha.script.make_classpath2$run_core.invokeStatic(make_classpath2.clj:82)
at clojure.tools.deps.alpha.script.make_classpath2$run_core.invoke(make_classpath2.clj:73)
at clojure.tools.deps.alpha.script.make_classpath2$run.invokeStatic(make_classpath2.clj:102)
at clojure.tools.deps.alpha.script.make_classpath2$run.invoke(make_classpath2.clj:96)
at clojure.tools.deps.alpha.script.make_classpath2$_main.invokeStatic(make_classpath2.clj:147)
at clojure.tools.deps.alpha.script.make_classpath2$_main.doInvoke(make_classpath2.clj:119)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.core$apply.invokeStatic(core.clj:665)
at clojure.main$main_opt.invokeStatic(main.clj:514)
at clojure.main$main_opt.invoke(main.clj:510)
at clojure.main$main.invokeStatic(main.clj:664)
at clojure.main$main.doInvoke(main.clj:616)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:40)
I'm running in docker (`clojure:openjdk-14-alpine`) with npm installed in my dockerfile.With :deps true
, you have to specify :paths
in deps.edn
instead of :source-paths
in shadow-cljs.edn
.
Sorry, that was just me messing around with things to try troubleshoot. I did originally have :paths in deps.edn as expected. I'll update the post to reflect how things were.
Ah, right. Notice the clojure.tools.deps.alpha.util.maven$version_range_QMARK_
in there. And then check your version for thheller/shadow-cljs
.
By <latest>
, shadow-cljs documentation just means that you should put the latest version of shadow-cljs there yourself.
aaaaaah. :man-facepalming: Let me try that..
@U05224H0W Do you think it would be worth it to specify in the documentation that <latest>
is just a placeholder and not an actual value that should be in there?
So yeah, that was the issue ๐.
Thanks for your help!
re: the <latest>
thing in the docs, it's not really a shadow-cljs issue, it's more of a deps.edn thing that I should've known about. However, in my defence, there isn't actually a section on how deps.edn parses those deps instructions that I could find anywhere.
[this page](https://clojure.org/guides/deps_and_cli) for example doesn't even mention sourcing libs from maven/clojars at all...
This is a reference to the deps.edn
file, a bit more information dense than the guide that you linked: https://clojure.org/reference/deps_and_cli
oh yeah should probably clarify that. I think deps.edn actually allows "LATEST" as version, maybe I should use that
I know that "RELEASE" can cause some cache issues. I.e. tools.deps won't check for a new version - it will just use the latest release available in the .m2. I have no idea whether "LATEST" has the same issue - maybe it's worth finding it out.
@U2FRKM4TW, you're right that the whole page is about git and maven, but if you come to that page with the question "How do I use a library from clojars?", it's not immediately apparent. You have to kinda put together the puzzle pieces. On the other hand, I may just be thick...
This bit from the second page you linked help answer the question a lot better imo > The deps are a map of library to coordinate. The library is (in Maven terms) the groupId and artifactId, which are sufficient to locate the desired project. The coordinate is used to describe a particular version that is being requested from a particular provider (like Maven).
And it doesn't make sense to add info about Clojars in there. Clojars is just a particular instance of a Maven repository. Maven Central is another one. And there are many, many others. It wouldn't make sense to describe them all in the tools.deps documentation - you just have to know whether what you're using is a Maven repository or not.
I see your point ๐
I hope you can point me in the right direction, I am working on re-frame app, there is column to mark favorites, I want this favorite thing to be a separate component because Iโm planning to use it in another component, how I do that? is there any tutorial?
thanks
I got stuck on this for a bit https://github.com/cognitect/transit-cljs/issues/48 , adding the newer transit-js dep to my project fixed it as described, but anyone know why the project.clj in the transit-cljs repo says version "0.8.243" and DOES include the correct transit-js dep, but when including version "0.8.256" in my own project it brings in an older version of transit-js ?
Because the pom is the real build file