This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-22
Channels
- # 100-days-of-code (3)
- # announcements (7)
- # beginners (147)
- # cider (22)
- # cljdoc (24)
- # cljs-dev (71)
- # cljsrn (8)
- # clojars (3)
- # clojure (45)
- # clojure-conj (11)
- # clojure-dev (1)
- # clojure-italy (21)
- # clojure-nl (2)
- # clojure-spec (76)
- # clojure-sweden (2)
- # clojure-uk (100)
- # clojurebridge (3)
- # clojurescript (15)
- # cursive (7)
- # data-science (2)
- # datomic (7)
- # emacs (9)
- # events (2)
- # figwheel-main (4)
- # fulcro (117)
- # jobs (2)
- # jobs-discuss (21)
- # leiningen (184)
- # nyc (4)
- # off-topic (50)
- # planck (6)
- # re-frame (14)
- # reagent (25)
- # ring-swagger (5)
- # shadow-cljs (96)
- # spacemacs (5)
- # sql (26)
- # tools-deps (12)
- # uncomplicate (1)
- # yada (3)
Now I'm trying to take the shadow-cljs electron example code (https://github.com/shadow-cljs/examples/tree/master/electron) and connect to the main and renderer processes with emacs cider-connect-cljs (renderer first) then with cider-connect-sibling-cljs (main). When I do the renderer everything looks okay (other than a middleware mismatch error cuz I'm using the latest snapshot) but when I do the sibling it appears to give me the same repl and it has a bunch of errors:
...
;;
;; You can remove this message with the <M-x cider-repl-clear-help-banner> command.
;; You can disable it from appearing on start by setting
;; 'cider-repl-display-help-banner' to nil.
;; ======================================================================
shadow.user>
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.4.0 (package: 20180826.2149) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings. To quit, type: :cljs/quit
[:selected :renderer]
WARNING: No such namespace: shadow, could not locate shadow.cljs, shadow.cljc, or JavaScript source providing "shadow" (<stdin> at 1:55)
WARNING: Use of undeclared Var shadow/watch (<stdin> at 1:55)
WARNING: No such namespace: shadow, could not locate shadow.cljs, shadow.cljc, or JavaScript source providing "shadow" (<stdin> at 1:76)
WARNING: Use of undeclared Var shadow/nrepl-select (<stdin> at 1:76)
cljs.user>
there's a 2nd repl buffer that is created with similar, but not quite exactly the same, results:
...
;;
;; You can remove this message with the <M-x cider-repl-clear-help-banner> command.
;; You can disable it from appearing on start by setting
;; 'cider-repl-display-help-banner' to nil.
;; ======================================================================
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.4.0 (package: 20180826.2149) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.
shadow.user> TypeError: shadow.watch is not a function
at eval (eval at <anonymous> (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:829:8), <anonymous>:4:8)
at eval (eval at <anonymous> (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:829:8), <anonymous>:7:3)
at file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:829:8
at Object.shadow$cljs$devtools$client$env$repl_call [as repl_call] (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.env.js:139:108)
at Object.shadow$cljs$devtools$client$browser$repl_invoke [as repl_invoke] (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:827:46)
at shadow$cljs$devtools$client$browser$handle_message (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:907:44)
at Object.shadow$cljs$devtools$client$env$process_ws_msg [as process_ws_msg] (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.env.js:258:102)
at WebSocket.<anonymous> (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:1002:40)
shadow.user>
The 2nd repl's buffer status says it's only pending. The renderer repl doesn't initially have those (non-middleware) errors until after the sibling is created.
From the terminal(s) the repls work perfectly. The renderer can do things like (js/alert "foo") and it works. The main issues an error when trying to do that (as it should because its only the launcher).
Help!?!?Likely you don’t have refactor-nrepl
in your deps. I guess if you don’t need it you can simply remove clj-refactor
(or its warnings) and you’ll be just fine.
@bozhidar I have no clue how emacs handles multiple CLJS repls but to me it looks like code intended for a CLJ REPL is getting sent to a CLJS REPL instead
> The 2nd repl’s buffer status says it’s only pending. The renderer repl doesn’t initially have those (non-middleware) errors until after the sibling is created.
shadow-cljs only provides a CLJ nrepl you can connect to directly. everything else is handled by the user.
@thheller Recent changes. Those commands connect to a Clojure REPL and upgrade it automatically to cljs (the difference between the two is that one create a new session in CIDER, the other adds a connection to the existing session).
@bozhidar the 2nd buffer says its a "pending-cljs" type
the first one is already broken too .. those warnings also mean that (shadow/watch ...)
was eval'd in a CLJS context not CLJ
well, that was something I meant to ask you. Is the watch command correct on that example? shadow-cljs watch main renderer
My understanding is there's supposed to be two processes. Does that create two? Like I said, from the terminal repl everything seems to be fine so I'm assuming so but just wondering. Shouldn't there be two nrepl's? It seems that both repls are connecting to the same port (at least from cider)
and so only one nrepl socket port
@bozhidar I have the [refactor-nrepl "2.4.0"]
in the shadow-cljs.edn file (along with [cider/cider-nrepl "0.19.0-SNAPSHOT"]
)
so do(es) my issue(s) above constitute a bug I should report do you think?
what is the difference between shadow and shadow-select when selecting the session type?
when I just do cider-connect-cljs
instead of cider-connect-sibling-cljs
for the 2nd repl the pending repl issues this error instead of the namespace ones above:
No application has connected to the REPL server. Make sure your JS environment has loaded your compiled ClojureScript code.
electron is running by executing electron .
in the project folder