BetterThanTomorrow / calva

Clojure & ClojureScript Interactive Programming for VS Code
https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva
Other
1.62k stars 213 forks source link

Cannot jack in after `shadow-cljs start` #452

Open filipesilva opened 4 years ago

filipesilva commented 4 years ago

Shadow-cljs allows having a background server running via shadow-cljs start. This speeds up individual shadow cljs invocations significantly and is useful for doing different builds or running commands via shadow-cljs run.

If I jack in when there is no background server, it all goes smoothly and a terminal shows the following:

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

shadow-cljs - config: d:\work\learn-re-frame-course-files\cheffy\shadow-cljs.edn  cli version: 2.8.69  node: v10.16.0
shadow-cljs - updating dependencies
shadow-cljs - dependencies updated
shadow-cljs - HTTP server available at http://localhost:3000
shadow-cljs - server version: 2.8.69 running at http://localhost:9630
shadow-cljs - nREPL server started on port 3333
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (691 files, 1 compiled, 0 warnings, 9.60s)

But I I start a server beforehand, the output pane stays stuck on Jacking in... and never proceeds:

$ yarn shadow-cljs start
yarn run v1.17.3
$ D:\work\learn-re-frame-course-files\cheffy\node_modules\.bin\shadow-cljs start
shadow-cljs - config: D:\work\learn-re-frame-course-files\cheffy\shadow-cljs.edn  cli version: 2.8.69  node: v10.16.0
shadow-cljs - server starting ..................................... ready!
Done in 10.14s.
> Executing task: C:\Program Files\nodejs\npx.cmd shadow-cljs -d cider/piggieback:0.4.1 -d cider/cider-nrepl:0.22.4 watch :app <

shadow-cljs - config: d:\work\learn-re-frame-course-files\cheffy\shadow-cljs.edn  cli version: 2.8.69  node: v10.16.0
shadow-cljs - connected to server
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (691 files, 690 compiled, 0 warnings, 46.46s)

I thought this might be because now the terminal log doesn't have the nREPL info and maybe that tripped up the calva connect sequence for shadow-cljs. But I'm not sure because the current isConnectedRegExp doesn't match anything in the logs either.

I asked @thheller about this and he indicated that those log messages are now in the .shadow-cljs/server.stdout.log and .shadow-cljs/server.stdout.log files. The messages are printed to the files when the server starts and not when Calva tries to connect to it. Since the nrepl.port file is also created on server startup and Calva looks for files created in .shadow-cljs, I suppose it will never see the file being created and just wait for that.

slowdownitsfine commented 4 years ago

I have the same issue when trying to jack-into a running shadow-cljs watch on macOS.

shadow-cljs@2.8.83

slowdownitsfine commented 4 years ago

Just fyi, It seems to be working for me again now. Thanks!

filipesilva commented 4 years ago

@dcusan odd, in my case nothing changed...

PEZ commented 4 years ago

Seems we need to look at the various shadow-cljs jack-in scenarios a bit. Sorry for late response.