This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-21
Channels
- # announcements (12)
- # aws (1)
- # babashka (82)
- # beginners (89)
- # calva (8)
- # cider (20)
- # clj-kondo (1)
- # clojars (9)
- # clojure (120)
- # clojure-australia (3)
- # clojure-europe (14)
- # clojure-france (24)
- # clojure-germany (3)
- # clojure-italy (16)
- # clojure-nl (1)
- # clojure-spec (3)
- # clojure-uk (22)
- # clojurescript (26)
- # cursive (38)
- # datascript (1)
- # emacs (10)
- # events (1)
- # helix (7)
- # jackdaw (5)
- # jobs-discuss (37)
- # lambdaisland (10)
- # malli (20)
- # meander (2)
- # off-topic (15)
- # pathom (42)
- # quil (1)
- # re-frame (38)
- # react (2)
- # reitit (2)
- # reveal (9)
- # rewrite-clj (3)
- # ring (5)
- # shadow-cljs (84)
- # spacemacs (1)
- # tools-deps (23)
- # vim (8)
- # vscode (1)
Anyone here using shadow-cljs in an ubuntu 20.04 environment under WSL2 on WIndows 10? After upgrading from WSL1 to WSL2, shadow-cljs doesn't recognize diffs in my files so it doesn't recompile. Basically hot reloading doesn't work. Force compile from the server doesn't generate new files either. Anyone know what to do to fix this?
stick with wsl1. thats a known problem on the wsl2 side, nothing shadow-cljs can do about that
wsl1 actually is better anyways if you work on the files from the windows side anyways. network also becomes quite annoying since the wsl2 container gets its own IP and stuff. IMHO WSL1 is still better and I use that still.
I had to upgrade to WSL2 because nginx didn't work properly in WSL1. And unfortunatly I need this to work since we want dev and prod environments to be as similar as possible. I will try to move my projects to the linux filesystem and see if that maybe helps.
But yeah, I do everything from inside the wsl, even the editor runs from there (using X, kitty, nvim or alternatively vscode with their very good wsl support)
@thheller I fixed the issue. Changes to the file now does trigger recompile. 1. I git cloned all my repositories to /home/user/src in the linux filesystem. 2. I mapped the linux filesystem network folder to a normal drive foler. Follow this short guide: https://support.microsoft.com/en-us/windows/map-a-network-drive-in-windows-10-29ce55d1-34e3-a7e2-4801-131475f9557d 3. Then I opened my repository folder with Intellij (also works with VS Code). 4. Make changes in intellij to the file -> shadow-cljs compiles and nginx serves the new file. Probably works without nginx too.
BTW. The compilation time seems to be faster too now. But this is just a feeling I have now, no hard data behidn that statement. 😛
@thheller I notice that shadow-cljs fails to connect to the websocket when the server is serving the files over 127.0.0.1 instead of localhost. Is it possible to perhaps have the reconnection logic try both? I know it is possible to specify the host in the config file, so it is a minor issue. I just think it might lead to a bit of confusion for some?
thats not something that is fixable I think. I mean if you connect to 127.0.0.1 that would need to map to the container ip
dunno how that is handled for localhost, maybe thats another adapter or has some forwarding logic
by default the browser websocket connect logic will use the host you used to open the page
Ah really?
server {
listen 127.0.0.1:80;
include /home/dev/src/locations.conf;
}
THis is what I have in my nginx config.Nothing special on the windows side. The locations is just:
location /client/ {
alias /home/dev/src/client/resources/public/;
}
So going to 127.0.0.1/client/ will load up everything. Shadow-cljs is stuck reconnecting and then stops trying. Changing it to localhost makes shadow-cljs connect right away and everythign works. :xneat, guess I should test that again. dealing with network ports was very annoying last time I tried
Yeah
:http {:port 9630
:host "127.0.0.1"}
this does not help. Looks like the server is not started at http://127.0.0.1:9630/, at least my browser shows nothing when trying to open that page. So even when specifying the host, the reconnection fails.NAME STATE VERSION
* Ubuntu-20.04 Running 2
Hehe I don't think so. I will check things on my side.
No, I haven't 😮
because this had some TIL for me https://github.com/microsoft/WSL/issues/4851
a quote, because sometimes I am surprised that a vague memory turns out to be resonant > Tag needs-investigation in the sense this needs a ruling on whether the current (circa 19640) behavior of the magic WSL localhost tunnel is by-design (by fiat), or should route ipv4 `127.0.0.1` to ipv6 `::1` automatically like it does on Linux.
I upgraded to 2.12.5 and get the following when running a watch:
[2021-04-21 10:03:22.948 - WARNING] :shadow.cljs.devtools.server/nrepl-ex
Note: The following stack trace applies to the reader or compiler, your code was not executed.
CompilerException Syntax error compiling at (clojure/tools/reader/edn.clj:75:9). #:clojure.error{:phase :compile-syntax-check, :line 75, :column 9, :source "clojure/tools/reader/edn.clj"}
clojure.lang.Compiler.analyze (Compiler.java:6808)
clojure.lang.Compiler.analyze (Compiler.java:6745)
clojure.lang.Compiler$InvokeExpr.parse (Compiler.java:3820)
clojure.lang.Compiler.analyzeSeq (Compiler.java:7109)
clojure.lang.Compiler.analyze (Compiler.java:6789)
clojure.lang.Compiler.analyze (Compiler.java:6745)
clojure.lang.Compiler$IfExpr$Parser.parse (Compiler.java:2837)
clojure.lang.Compiler.analyzeSeq (Compiler.java:7107)
clojure.lang.Compiler.analyze (Compiler.java:6789)
clojure.lang.Compiler.analyze (Compiler.java:6745)
clojure.lang.Compiler$BodyExpr$Parser.parse (Compiler.java:6120)
clojure.lang.Compiler$LetExpr$Parser.parse (Compiler.java:6436)
Caused by:
RuntimeException No such var: err/throw-no-dispatch
clojure.lang.Util.runtimeException (Util.java:221)
clojure.lang.Compiler.resolveIn (Compiler.java:7388)
clojure.lang.Compiler.resolve (Compiler.java:7358)
clojure.lang.Compiler.analyzeSymbol (Compiler.java:7319)
clojure.lang.Compiler.analyze (Compiler.java:6768)
clojure.lang.Compiler.analyze (Compiler.java:6745)
lein deps :tree
shows that shadow-cljs depends on org.clojure/tools.reader "1.1.3.1"
if nothing else shows up on the deps tree depending on it, how do I know what's pulling in the wrong tools.reader version?
do you use profiles? did you active those that would be activated when starting shadow-cljs?
user=> ( "clojure/tools/reader/edn.clj")
#object[java.net.URL 0x440076b6 "jar:file:/Users/lilactown/.m2/repository/org/clojure/tools.reader/1.1.3.1/tools.reader-1.1.3.1.jar!/clojure/tools/reader/edn.clj"]
thats the wrong version? https://clojars.org/thheller/shadow-cljs
lein deps :tree
shows the following output:
[thheller/shadow-cljs "2.12.5" :exclusions [[fipp] [edn-query-language/eql] [com.wsscode/pathom]]]
[cider/piggieback "0.5.0" :exclusions [[org.clojure/clojure] [org.clojure/clojurescript] [nrepl]]]
[javax.xml.bind/jaxb-api "2.3.1"]
[javax.activation/javax.activation-api "1.2.0"]
[com.bhauman/cljs-test-display "0.1.1"]
[com.google.javascript/closure-compiler-unshaded "v20210302"]
[expound "0.8.5"]
[hiccup "1.0.5"]
[org.clojure/clojure "1.10.1"]
[org.clojure/core.specs.alpha "0.2.44"]
[org.clojure/spec.alpha "0.2.176"]
[org.clojure/clojurescript "1.10.844" :exclusions [[com.google.javascript/closure-compiler-unshaded] [org.clojure/google-closure-library] [org.clojure/google-closure-library-third-party]]]
[org.clojure/core.async "0.3.465"]
[org.clojure/tools.analyzer.jvm "0.7.2"]
[org.clojure/core.memoize "0.5.9"]
[org.clojure/tools.analyzer "0.6.9"]
[org.ow2.asm/asm-all "4.2"]
[org.clojure/data.json "1.0.0"]
[org.clojure/google-closure-library-third-party "0.0-20201211-3e6c510d"]
[org.clojure/google-closure-library "0.0-20201211-3e6c510d"]
[org.clojure/tools.cli "1.0.194"]
[org.clojure/tools.reader "1.1.3.1"]
I would expect tools.reader
to appear elsewhere in the tree as well if something else depended on it?
I'm in a monorepo that uses lein-monolith, and both tools.reader and core.async are in managed-dependencies in the root project.clj
I am trying to compile a serverless project with shadows-cljs which it was working until i add mongodb library from node. it seems the compilation process skip some dependency requiered by mongodb import. Someone have fall down into this before?
When i bundle the serverless app, look like mongodb library require some extra dependency to be inmported correctly i added theses manually to the package.json but when i run the project the bundle js dont found thoses
i have this when i compile:
:js-options {
:js-provider :shadow
:keep-native-requires true
}
@thheller i just had to create again the stacktrace:
'Module not provided: mongodb-extjson'
ok, that might be dynamically required (which shadow-cljs doens't detect or bundle) or it might be a native dependency