This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-14
Channels
- # adventofcode (38)
- # announcements (42)
- # aws (3)
- # babashka (8)
- # beginners (165)
- # calva (36)
- # chlorine-clover (14)
- # cider (6)
- # clj-kondo (5)
- # cljsrn (33)
- # clojure (27)
- # clojure-australia (1)
- # clojure-czech (1)
- # clojure-doc (1)
- # clojure-europe (26)
- # clojure-nl (6)
- # clojure-spec (6)
- # clojure-uk (3)
- # clojurescript (10)
- # code-reviews (20)
- # conjure (1)
- # core-logic (5)
- # cursive (3)
- # data-science (5)
- # datomic (35)
- # emacs (1)
- # figwheel-main (3)
- # fulcro (10)
- # honeysql (1)
- # introduce-yourself (4)
- # jobs (3)
- # jobs-discuss (4)
- # minecraft (2)
- # missionary (28)
- # nextjournal (3)
- # off-topic (45)
- # pathom (7)
- # polylith (1)
- # portal (22)
- # practicalli (2)
- # re-frame (4)
- # reagent (19)
- # releases (3)
- # remote-jobs (3)
- # reveal (1)
- # rum (4)
- # shadow-cljs (37)
- # spacemacs (14)
- # sql (1)
- # tools-build (7)
- # tools-deps (16)
- # vim (13)
- # xtdb (15)
Could anyone help me out with these errors I'm getting when I run npx shadow-cljs watch :app
? I don't know what they mean or how to fix them.
shadow-cljs - config: C:\Users\JaceMaverick\Downloads\quickstart-browser-master\quickstart-browser-master\shadow-cljs.edn
shadow-cljs - socket connect failed, server process dead?
shadow-cljs - HTTP server available at
shadow-cljs - server version: 2.16.8 running at
shadow-cljs - nREPL server started on port 55621
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (277 files, 0 compiled, 0 warnings, 4.96s)
Dec 13, 2021 10:00:47 PM io.undertow.server.Connectors executeRootHandler
ERROR: UT005071: Undertow request failed HttpServerExchange{ GET /}
Unexpected error macroexpanding go at (com/wsscode/pathom/connect.cljc:1177:8).
at clojure.lang.Compiler.macroexpand1(Compiler.java:7023)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7097)
at clojure.lang.Compiler.analyze(Compiler.java:6793)
at clojure.lang.Compiler.analyze(Compiler.java:6749)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6122)
at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6440)
...
@jacemaverick5 I'm guessing you have a conflicting core.async version in your :dependencies
? Just remove it shadow-cljs already provides one
otherwise make sure you use the version listed here or newer https://clojars.org/thheller/shadow-cljs
Ohno... what is the proper way to have multiple pages? I've added multiple entries to my script but this seems to break code reload because it calls init
on both namespaces
Maybe the proper way is a client side router... I was just trying to have actual separate HTML pages.
@pepijndevos can’t you do multiple builds?
But then I'd have to run multiple watches to develop the app
Ah you can actually just pass multiple builds
It seems like you could also have multiple modules to a build, but this is... confusing
ah I think I figured it out!
also see https://code.thheller.com/blog/shadow-cljs/2019/03/03/code-splitting-clojurescript.html
Is there a command I can run so that all dependencies needed for npx shadow-cljs watch <something>
will be downloaded and when I actually run watch, I won't need internet access? 🙏
pretty much all commands will accomplish this assuming you are not using any shapshot dependencies or so
Thank you!
But does classpath download also the dev - only dependencies such as Ring?
I don't understand. shadow-cljs has no "dev only" concept at all regarding dependencies?
Hi all, I'm a little confused on how shadow-cljs prints certain exceptions. For example, if I evaluate this snippet at the REPL:
(defn greeting-for
[name]
{:pre [(string? name)]}
(str "Hello " name))
(greeting-for 123)
The assert will of course fail, but the only output I get back from the REPL is:
#object[Error Error: Assert failed: (string? name)]
No stack trace, no mention of which function's assert failed. Is there some way to get it to actually display the details of the Error
thrown, instead of just its message
field?I should mention as well, I'm not sure if this is a shadow-cljs-specific issue or just a ClojureScript issue. I can ask in #clojurescript if it's not shadow-cljs related
showing a proper stacktrace is kinda difficult for REPL eval'd code. it should be much better for code loaded from actual files
I get that the line numbers would be messed up, but is there no way to even show the function names called?
That alone would be tremendously helpful. Even if it just showed the mangled js-generated function names, that would probably be enough for me to tell where the error is coming from
eg.
$ clj
Clojure 1.10.1
(defn greeting-for
[name]
{:pre [(string? name)]}
(str "Hello " name))
#'user/greeting-for
user=> (greeting-for 123)
Execution error (AssertionError) at user/greeting-for (REPL:1).
Assert failed: (string? name)
user=> (pst)
AssertionError Assert failed: (string? name)
user/greeting-for (NO_SOURCE_FILE:1)
user/greeting-for (NO_SOURCE_FILE:1)
user/eval148 (NO_SOURCE_FILE:1)
user/eval148 (NO_SOURCE_FILE:1)
clojure.lang.Compiler.eval (Compiler.java:7177)
clojure.lang.Compiler.eval (Compiler.java:7132)
clojure.core/eval (core.clj:3214)
clojure.core/eval (core.clj:3210)
clojure.main/repl/read-eval-print--9086/fn--9089 (main.clj:437)
clojure.main/repl/read-eval-print--9086 (main.clj:437)
clojure.main/repl/fn--9095 (main.clj:458)
clojure.main/repl (main.clj:458)
nil
user=>
That is a shame about (pst)
being broken, but good tips, thanks!
Hi again! I am running npx shadow-cljs watch main
and it does compile and prints watching build :main
yet the browser says
> Stale output! Your loaded JS was not produced by the running shadow-cljs instance.
How do I troubleshoot this?
(I load the app via the backend server, not shadow dev server)
I even deleted the main.js before restarting shadow to make sure that it is built by shadow.
Solved: I was starting shadow in the wrong project 😅
also make sure you are actually loading the file you think you are loading. often people change :output-dir
but forget to adjust paths in HTML or so
delete the file shadow-cljs is producing and load your page. if you get something then thats not the file you are loading :P
Yeah, st. is fishy, when I rm the file and stop shadow, the file does not exist but the server still happily serves it...