avli / clojureVSCode

Clojure support for Visual Studio Code
https://avli.github.io/clojureVSCode/
MIT License
204 stars 34 forks source link

Error when start nREPL on new lein project #151

Closed lucasteles closed 4 years ago

lucasteles commented 4 years ago

Visual Studio Code

Version: 1.43.1 (user setup) Commit: fe22a9645b44368865c0ba92e2fb881ff1afce94 Date: 2020-03-18T07:01:20.184Z Electron: 7.1.11 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT x64 10.0.18362

Steps to reproduce:

lein new app app-name
cd app-name
code . 

shows Starting nREPL... and then after 10 secs crashes (nREPL exited with code 1) and shows stacktrace in Output & Console.

Shows the errors Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Unable to resolve var: cider.nrepl/wrap-apropos in this context

If i start VSCode in a folder with just one standalone clojure file, they works

avli commented 4 years ago

Which Leiningen version do you use? It seems to be the same issue as https://github.com/clojure-emacs/cider-nrepl/issues/608.

lucasteles commented 4 years ago

@avli Leiningen 2.9.3 on Java 13.0.1 OpenJDK 64-Bit Server VM

lucasteles commented 4 years ago

@avli i dont think is the same problem, my Lein is in v2.9

How can i check Cider version? that is a thing i can update?

ErwanDL commented 4 years ago

Having the exact same problem as lucasteles, Leiningen 2.9.3 on Java 13.0.2 Java HotSpot(TM) 64-Bit Server VM. I can start the nrepl from the command line by typing lein repl, but in VSCode the Starting nREPL... icon appears and after a moment I get an error notification nREPL exited with code 1.

Output panel logs : ``` Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Syntax error compiling var at (/private/var/folders/88/26xg7d096x7gztffx44yb9f80000gp/T/form-init6989802207003301932.clj:1:9089). Unable to resolve var: cider.nrepl/wrap-apropos in this context Full report at: /var/folders/88/26xg7d096x7gztffx44yb9f80000gp/T/clojure-4814943021023505629.edn Subprocess failed (exit code: 1) nREPL exited with code 1 ```

EDIT : Downgrading the version of cider-nrepl has solved the issue for me. It was previously in 0.25-alpha, and I downgraded it to 0.22 by adding :plugins [[cider/cider-nrepl "0.22.1"] to my project.clj file.

jellenberger commented 4 years ago

Same problem here on Leiningen 2.9.3 with Java 11.0.7. Downgrading to cider-nrepl 0.22.1, per @ErwanDL's comment, solves it.

dogweather commented 4 years ago

Yes, from @ErwanDL , adding this:

  :plugins [[cider/cider-nrepl "0.22.1"]]

to project.clj works.

avli commented 4 years ago

OK, this one is definitely caused by the outdated CIDER nREPL version that was used by the embedded nREPL. Thanks all for figuring this out! The new version with the fix is on the Visual Studio Code marketplace.

Indeed, since the issue pops up periodically (e.g. #120, #121, #123), I have added a setting that allows redefining the cider-nrepl plugin version that the embedded nREPL uses per project. Please see the Contributed Configuration and Troubleshooting README sections.

For example, to make the embedded nREPL to use the 0.24.0 version of cider-nrepl put the following in project's settings.json:

{
    "clojureVSCode.ciderNReplVersion": "0.24.0"
}

Another option is to put the development environment plugins in ~/.lein/profiles.clj (see the example here).

Keep in mind, that settings from project.clj and profiles.clj seems to override the extension settings, and that is the reason I don't notice the issues like this in the first place :-)

dogweather commented 4 years ago

Indeed, since the issue pops up periodically (e.g. #120, #121, #123)

Thanks for fixing the root problem!