Fork me on GitHub
#shadow-cljs
<
2019-07-30
>
orestis12:07:06

Hi, I’ve upgraded shadow to 2.8.41 and I’m seeing some issue with my UI not re-rendering any more when I edit “leaf” dependency files. But it’s super weird because I see that Shadow HUD, I see that it picked up the changed file and its dependees, it called my :dev/after-load function, but my app isn’t rerendering at all. Editing a file further up the chain does the trick.

orestis12:07:59

I can’t reproduce it any more after a browser restart, it was a new file that I added, not sure what the culprit was. I’m doing just plain saves and waiting for shadow to pick up things, no REPL interactions.

thheller13:07:13

nothing has changed with reloading in quite a while so I somehow doubt that the upgrade affected anything that wasn't there before?

thheller13:07:41

I'll be writing an in-depth blog post about hot-reload in shadow-cljs soon to hopefully clear up how everything works

thheller13:07:12

so it easier to track down why something might not work as you'd expect

orestis13:07:12

Yeah I’m not sure what’s going on. After some recent upgrades (npm + shadow) I had this weird issue where I had to nuke everything from orbit every now and then. I’ve never seen this before with shadow, so I’m tempted to blame npm for this.

thheller13:07:53

there are some known problems with making too many changes in node_modules while shadow-cljs is running

thheller13:07:04

ie. npm install some-big-package-with-lots-of-dependencies

thheller13:07:19

or rather updating those packages

thheller13:07:00

but besides that I'm not aware of any issues

pez14:07:58

I get Could not locate shadow/cljs/devtools/cli__init.class, shadow/cljs/devtools/cli.clj or shadow/cljs/devtools/cli.cljc on classpath. when starting up one of my projects using 2.8.41. My project used to be usingh 2.8.8, and if I go back to that things work.

thheller14:07:41

you are likely using deps.edn which changed and you must now add theller/shadow-cljs to your deps.edn manually

pez14:07:57

Thanks. That works great.

pez14:07:52

I'm working with Calva jack-in and trying out different test projects I have. I run into problems with that deps.edn project on Windows. Since it needs clojure to run it also needs Powershell. I can make that happen, with some work. Would you say that checking for the existence of deps.edn is enough for detecting this situation before launching, @thheller?

thheller14:07:34

not sure I understand the question?

pez14:07:12

Let me add some more context... 😃

pez14:07:53

On Windows clojure can only be invoked in a Powershell environment. So if I just launch the process npx, this project fails. For general clojure-cli projects I therefore run clojure in a powershell.exe process. Thinking I could do the same for shadow projects that need clojure.

thheller14:07:39

I don't see why shadow-cljs is involved in this question? just run shadow-cljs normally. it'll do the right thing on windows?

thheller14:07:53

(I fixed the windows powershell support a couple releases ago)

thheller14:07:31

should be working normally now

thheller14:07:53

can't remember if it was 2.8.40 or earlier

pez14:07:39

OK. So maybe that was when I tried with 2.8.8... It behaves differently with 2.8.41 indeed, but still seems to need some special quoting on my part. I get this error now:

> Executing task: C:\Program Files\nodejs\npx.cmd shadow-cljs -d cider/cider-nrepl:0.21.1 watch :app <

npx: installed 92 in 12.938s
shadow-cljs - config: e:\rn-rf-shadow\shadow-cljs.edn  cli version: 2.8.41  node: v10.16.0
shadow-cljs - socket connect failed, server process dead?
shadow-cljs - starting via "clojure"
Unknown option: "-i"
Unknown option: "-n"
Unknown option: "-p"
Unknown option: "-u"
Unknown option: "-t"
Unknown option: "-F"
Unknown option: "-o"
Unknown option: "-r"
Unknown option: "-m"
Unknown option: "-a"
Unknown option: "-t"
Unknown option: "-o"
Unknown option: "-u"
Unknown option: "-t"
Unknown option: "-p"
Unknown option: "-u"
Unknown option: "-t"
Unknown option: "-F"
Unknown option: "-o"
Unknown option: "-r"
Unknown option: "-m"
Unknown option: "-a"
Unknown option: "-t"

thheller14:07:05

what the heck is that?

thheller14:07:14

oh I think I had that before yes

thheller14:07:24

-d cider/cider-nrepl:0.21.1 that is the issue

pez14:07:31

I've seen it before too. Been fighting with powershell for several days now..

thheller14:07:22

right yeah I forgot. feel free to open an issue about that

thheller14:07:39

powershell handles command line args in a weird way to that probably needs to be adjusted somehow

thheller14:07:13

one of the reason I opted to remove the dependency injection for shadow-cljs itself

thheller14:07:21

just causes way more issues than it solves

thheller14:07:42

so it probably works fine if you just add it to the deps.edn and run normally

pez14:07:06

Calva jack-in needs the injection way of doing things. I'll open an issue.

pez15:07:29

Here: https://github.com/thheller/shadow-cljs/issues/534 Let me know if I should add/retract something to make it usable.

thheller15:07:14

whats funny about the error is that shadow-cljs NEVER actually passes any of those args to powershell

thheller15:07:44

so I have no clue where that error is even coming from other than that it fails parsing the -Sdeps EDN data

thheller15:07:02

probably needs to be escaped or something. I'll take a look when I get a chance

pez15:07:40

I got it with some of my attempts to escape the jack-in command for clojure. Could be the slash there that gets things interpreted as an options...

thheller18:07:29

@pez try 2.8.42. hope that sorts out all the powershell escaping issues

pez20:07:40

@thheller that seems to fix it. However now i run into something else. It works on my Mac still, but on my (virtual) Windows I get this:

npx: installed 92 in 8.673s
shadow-cljs - config: e:\rn-rf-shadow\shadow-cljs.edn  cli version: 2.8.42  node: v10.16.0
shadow-cljs - starting via "clojure"
failed to start service
{:id :cljs-watch}
ExceptionInfo: failed to start service
        shadow.runtime.services/start-many/fn--9540 (services.clj:135)
        shadow.runtime.services/start-many (services.clj:126)
        shadow.runtime.services/start-many (services.clj:105)
        shadow.runtime.services/start-all (services.clj:144)
        shadow.runtime.services/start-all (services.clj:139)
        shadow.cljs.devtools.server/start-system (server.clj:370)
        shadow.cljs.devtools.server/start-system (server.clj:242)
        shadow.cljs.devtools.server/start! (server.clj:493)
        shadow.cljs.devtools.server/start! (server.clj:411)
        shadow.cljs.devtools.server/start! (server.clj:414)
        shadow.cljs.devtools.server/start! (server.clj:411)
        shadow.cljs.devtools.server/from-cli (server.clj:625)
        shadow.cljs.devtools.server/from-cli (server.clj:601)
        clojure.lang.Var.applyTo (Var.java:705)
        clojure.core/apply (core.clj:665)
        clojure.core/apply (core.clj:660)
        shadow.cljs.devtools.cli/lazy-invoke (cli.clj:24)
        shadow.cljs.devtools.cli/lazy-invoke (cli.clj:21)
        shadow.cljs.devtools.cli/blocking-action (cli.clj:131)
        shadow.cljs.devtools.cli/blocking-action (cli.clj:118)
        shadow.cljs.devtools.cli/main (cli.clj:179)
        shadow.cljs.devtools.cli/main (cli.clj:134)
        clojure.core/apply (core.clj:669)
        clojure.core/apply (core.clj:660)
        shadow.cljs.devtools.cli/-main (cli.clj:221)
        shadow.cljs.devtools.cli/-main (cli.clj:219)
        clojure.lang.Var.applyTo (Var.java:705)
        clojure.core/apply (core.clj:665)
        clojure.main/main-opt (main.clj:514)
        clojure.main/main-opt (main.clj:510)
        clojure.main/main (main.clj:664)
        clojure.main/main (main.clj:616)
        clojure.lang.Var.applyTo (Var.java:705)
        clojure.main.main (main.java:40)
Caused by:
IOException: Incorrect function.

        sun.nio.fs.WindowsWatchService$Poller.implRegister (WindowsWatchService.java:433)
        sun.nio.fs.AbstractPoller.processRequests (AbstractPoller.java:260)
        sun.nio.fs.WindowsWatchService$Poller.run (WindowsWatchService.java:595)
        java.lang.Thread.run (Thread.java:748)
It's this project: https://github.com/PEZ/rn-rf-shadow

thheller20:07:22

weird. never seen that before 😛

thheller20:07:50

maybe related to this?

pez20:07:01

Wow, Windows...

pez20:07:29

It could be because I am running the project from a network share (mounting the project on the Mac in Virtual Box).

camden20:07:24

anyone using shadow-cljs to build cypress tests written in cljs? i'd be curious to know how you're doing it, from a high level!

pez20:07:29

@thheller, indeed I only get that Incorrect function error when I run the project from that virtual box network mount. Things work if I run the project from the ”harddrive” of the Windows virtual machine.