clojure-emacs / cider

The Clojure Interactive Development Environment that Rocks for Emacs
https://cider.mx
GNU General Public License v3.0
3.55k stars 645 forks source link

sibling repl not working?? #2494

Closed vigilancetech-com closed 5 years ago

vigilancetech-com commented 6 years ago

Expected behavior

when, say, connecting to an electron main process repl and its renderer process repl they would be separate repls.

Actual behavior

you are directed to the first repl both times and the 2nd one is left in a "pending" status with errors.

Steps to reproduce the problem

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 apparently cuz I'm using the latest snapshot -- however FWIW shadow-cljs' creator Thomas Heller said its because the preludes are being injected into a cljs repl instead of a clj repl where they belong) 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.
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).

## Environment & Version information

### CIDER version information

;; CIDER 0.18.1snapshot (package: 20181014.2104), nREPL 0.4.5
;; Clojure 1.9.0, Java 1.8.0_162

### Lein/Boot version

I used shadow-cljs
$ shadow-cljs watch main renderer
shadow-cljs - config: /home/kevin/0work/examples/electron/shadow-cljs.edn  cli version: 2.6.11  node: v9.11.2

### Emacs version

GNU Emacs 25.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-08-21

### Operating system

Linux 4.9.0-sabayon #1 SMP x86_64
vspinu commented 6 years ago

I will try to reproduce this later this week. Sorry, swamped atm.

vigilancetech-com commented 6 years ago

I guess for the moment I can develop on one process at a time, but it would be really awesome if at some point I could do both. Plus it seems like something that should definitely work.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

stale[bot] commented 5 years ago

This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it.