Fork me on GitHub

[nREPL] Starting server via "c:/Program Files/nodejs/npx.cmd" shadow-cljs -d nrepl:0.4.5 -d cider/piggieback:0.3.10 -d refactor-nrepl:2.5.0 -d cider/cider-nrepl:0.19.0-SNAPSHOT server...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: shadow-cljs - config: c:\Users\my\project\path\shadow-cljs.edn
shadow-cljs - starting via "clojure"
WARNING: The configured :dependencies in shadow-cljs.edn were ignored!
         When using :deps they must be configured in deps.edn
clojure : Couldn't find 'java'. Please set JAVA_HOME.

At line:1 char:1

+ clojure -Sdeps `{:aliases` `{:shadow-cljs-inject` `{:extra-deps` `{nr ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException

    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-Clojure
Trying to cider-jack-in-cljs on Windows from Spacemacs. clojure CLI is installed and working when run directly from PowerShell. Also, $env:JAVA_HOME is correctly set. Any ideas or debugging tips?


I see lots of ancient versions. You’re six versions back on cider and a major version back on piggieback and 3 major versions back on nrepl


But also I’m seeing issues with deps.edn and shadow-cljs.edn fighting over who is in control

David Pham19:06:12

@robert.mather.rmm Can you start shadow-cljs watch app?

David Pham19:06:08

My experience with shadow-cljs is that is much better start the process in the terminal and connect to it from cider without C-c M-C

David Pham19:06:24

Maybe remove your deps as well.


@neo2551 Thanks, that's working much better. I'm used to Cursive, where I can stash one-off sexpers I want to eval inside a (comment ...) and send the "top-level" (not including the comment block) form to the REPL with a single command. Is there something similar in CIDER?


I'm talking about nothing more than having the cursor/point somewhere within the form I want to eval, not highlighting it, or being right at the end or something. Being able to eval either the topmost containing form, or the immediately containing form would be nice.


there is. check (setq clojure-toplevel-inside-comment-form t)

👍 6

i'm also a fan of

(setq cider-invert-insert-eval-p t)
(setq cider-switch-to-repl-on-insert nil)


these should be similar to the way that cursive evals things in the repl buffer


i like being able to choose to eval things without leaving a trace, and optionally, to send forms to the repl so see the input and output in the repl buffer


Here's a fun one, what if I want to eval a form in the ns of the current buffer, but without switching the REPL ns. Let's say I want to stay in the 'user' ns because I have some utilities there, and want to eval something without polluting the 'user' ns


So equivalent behavior to 'in-ns' into the buffer ns, eval the form, then 'in-ns' back.

David Pham21:06:45

I usually go to the end of the sexp and eval it with C-x C-e


Maybe this is something specific to Shadow-CLJS interaction, but I can't eval forms containing functions defined in the buffer. I get undeclared-var warnings that make it look like it's trying to eval under the 'cljs.user' ns even though the REPL buffer shows the correct ns.


@robert.mather.rmm which version do you use?


@thheller 'npm -g' installed 2.9.10 on Windows, calling from PowerShell


do you use deps.edn? then only the version included there matters. the npm version is less relevant.


I do, 2.10.0 in deps.edn


dont use 2.10.0, it has a couple issues with cider. stick with 2.9.10


Ok, I'll try that. Thanks


Cider inline sends along the current namespace and it should be evaled there. Insert into repl will not silently adjust the repl like cursive does


Ok. What I'm experiencing though: 1. Start 'shadow watch <build>' from CLI 2. Connect to nREPL from Cider with 'shadow-select' type 3. C-c C-k to load buffer (still see 'cljs.user', not file/buffer ns in REPL buffer) 4. C-c C-c doesn't work due to "Use of undeclared Var" from Shadow 5. C-c M-n n to set the REPL ns to match the buffer (seems to work, the REPL buffer changes to match the file ns) 6. C-c C-c still doesn't work with the same error


So even though the Cider REPL buffer shows the correct ns in the prompt, the warnings coming back from Shadow show everything ns-qualified with 'cljs.user'


i think there's a bug where CIDER needs its middleware on the classpath


cider/cider-nrepl {:mvn/version "0.25.1"}


Something other than that?


where is that? in deps.edn?


ok. let me keep looking then


Thanks for the support


my pleasure


Shadow is configured to use deps.edn, just FYI


This setup works for me from Cursive


i'm able to C-c C-c and get eval inline


and no errors in the repl about unbound vars


i did diverge a bit from your steps. i'm not using deps.edn, and i did shadow-cljs -d cider/cider-nrepl:0.25.1 server and then issued the watch from the repl


but i think this should more or less be equivalent


what is your CIDER version? i thought i remember it being quite old


=> nil So we diverge right there.


CIDER 0.19.0snapshot (package: 20181021.830), nREPL 0.7.0


can you try m-x nrepl-toggle-message-logging and try that again


Wow, that is old.


are you opposed to upgrading? i think we might be diagnosing a bug from over two years ago


I'm using Spacemacs (new to Emacs), just followed their Clojure layer instructions. I'm surprised it's that far back by default.


Not at all opposed, just not sure how.


i think there is a #spacemacs channel. I don't use it so can't help you with that


Ok, thanks. Sorry, didn't realize it was that far back.


no worries at all


but once you're up to date i'll work with you until you've got a happy repl experience

replied to a thread:I do, 2.10.0 in deps.edn

Ok, I'll try that. Thanks


@thheller @dpsutton Downgrading Shadow helped. Now I can get to a usable REPL, but there's still some disconnect in the state of the systems. For example, before explicitly loading the buffer (C-c C-k), I'm able to eval a pure function with C-c C-c and get the right result inline, but Shadow still warns "undeclared var". After loading, the warnings go away and things work cleanly.


It's as though different systems are relying on different sources to determine the runtime state.


Fortunately, this is good enough for me to get to work, so thank you both!


do you have a repo that's very bare and can reproduce in?


i'd like to run exactly what you are running


ok. i can recreate in 2.10.4 when running with deps. no idea why this is different but at least i can reproduce now


  id                             "14"
  op                             "eval"
  session                        "1fee8a75-f0c8-4546-8195-edba9b2588b0"
  time-stamp                     "2020-06-06 18:11:35.918714000"
  code                           "(defn ^:dev/after-load start []
  (r/render [app]
  column                         1
  file                           "/Users/dan/projects/clojure/shadow/src/app/main.cljs"
  line                           11
  nrepl.middleware.print/print   "cider.nrepl.pprint/pr"
  nrepl.middleware.print/quota   1048576
  nrepl.middleware.print/stream? nil
  ns                             #("app.main" 0 8 (fontified t help-echo cider--help-echo cider-locals nil cider-block-dynamic-font-lock t face font-lock-type-face))
that seems like a valid nrepl message.


i think shadow maybe used to load the namespaces when compiling. it seems like it now until the namespace has been created, evaluating in that is throwing an error. seems much closer to clojure and correct now i think