This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-31
Channels
- # announcements (20)
- # asami (14)
- # aws (6)
- # babashka (15)
- # beginners (83)
- # biff (6)
- # calva (93)
- # cider (3)
- # clj-kondo (21)
- # cljdoc (106)
- # cljs-dev (32)
- # clojure (165)
- # clojure-dev (78)
- # clojure-europe (54)
- # clojure-italy (9)
- # clojure-nl (9)
- # clojure-norway (24)
- # clojure-uk (4)
- # clojurescript (6)
- # community-development (2)
- # conjure (2)
- # core-typed (14)
- # datahike (4)
- # datomic (2)
- # emacs (40)
- # events (1)
- # fulcro (11)
- # graalvm-mobile (29)
- # graphql (8)
- # honeysql (19)
- # java (1)
- # jobs (1)
- # lsp (232)
- # malli (5)
- # membrane (112)
- # nextjournal (11)
- # off-topic (63)
- # portal (12)
- # re-frame (6)
- # reagent (3)
- # reitit (4)
- # rewrite-clj (2)
- # shadow-cljs (25)
- # tools-deps (6)
I'm hitting an interesting behavior when I load portal
in a clj project from a git hash. If I include in my deps.edn:
djblue/portal {:mvn/version "0.22.1"}
all works as intended, while if I do something like:
com.github.djblue/portal {:sha "2d817e99b819a8692465cfac357e6a2770d80109"}
(note that this is the hash corresponding to the 22.1 release) when I call p/open
I get a blank page instead of the usual UI. What could be going on here?In the case in which portal
doesn't work, in the browser console I get errors like:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
This is due to the git source missing the compiled js artifact for the cljs code
thank you @U04V70XH6! Is there something that I could do to workaround this? I mean, in general?
In theory, @U1G869VNV could add a "prep" step that could run the build (locally) and produce the artifacts needed. See https://clojure.org/reference/deps_and_cli#prep Although, given that there's no build.clj
in the project, I don't know that could be automated yet -- and it would rely on you as a git deps user having all the necessary tooling installed locally in order to run that build step (node, npm, shadow, etc I believe).
But for some projects, yes, the deps prep approach is relatively straightforward -- where they just need Java code compiled, or some Clojure code AOT'd.
Portal does https://github.com/djblue/portal/blob/master/dev/tasks/build.clj#L13-L27, but it needs a little tweaking to making it clj/prep-able :thinking_face:
https://github.com/djblue/portal/commit/d02528afba2fb57498597680009ef30b0979527d should add prep support, let me know what happens
Might need to do clj -X:deps prep :aliases '[:dev]'
if portal is brought in via :extra-deps
This is what happens now if I try to start a repl in a project in which I included a git dependency on portal:
error in process sentinel: Could not start nREPL server: Error building classpath. count not supported on this type: Symbol
java.lang.UnsupportedOperationException: count not supported on this type: Symbol
at clojure.lang.RT.countFrom(RT.java:671)
at clojure.lang.RT.count(RT.java:643)
at clojure.tools.deps.alpha.extensions.git$full_sha_QMARK_.invokeStatic(git.clj:36)
at clojure.tools.deps.alpha.extensions.git$fn__1403.invokeStatic(git.clj:72)
at clojure.tools.deps.alpha.extensions.git$fn__1403.invoke(git.clj:55)
at clojure.lang.MultiFn.invoke(MultiFn.java:239)
at clojure.tools.deps.alpha$canonicalize_deps$fn__746.invoke(alpha.clj:365)
at clojure.core.protocols$iter_reduce.invokeStatic(protocols.clj:49)
at clojure.core.protocols$fn__8162.invokeStatic(protocols.clj:75)
at clojure.core.protocols$fn__8162.invoke(protocols.clj:75)
at clojure.core.protocols$fn__8110$G__8105__8123.invoke(protocols.clj:13)
at clojure.core$reduce.invokeStatic(core.clj:6830)
at clojure.tools.deps.alpha$canonicalize_deps.invokeStatic(alpha.clj:362)
at clojure.tools.deps.alpha$resolve_deps.invokeStatic(alpha.clj:494)
at clojure.tools.deps.alpha$calc_basis.invokeStatic(alpha.clj:742)
at clojure.tools.deps.alpha.script.make_classpath2$run_core.invokeStatic(make_classpath2.clj:132)
at clojure.tools.deps.alpha.script.make_classpath2$run.invokeStatic(make_classpath2.clj:174)
at clojure.tools.deps.alpha.script.make_classpath2$_main.invokeStatic(make_classpath2.clj:228)
at clojure.tools.deps.alpha.script.make_classpath2$_main.doInvoke(make_classpath2.clj:195)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.core$apply.invokeStatic(core.clj:667)
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)