avli / clojureVSCode

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

nREPL starting forever #82

Closed skaurus closed 6 years ago

skaurus commented 6 years ago

Hi!

I have Leiningen 2.7.1 on Java 1.8.0_151 installed on Windows 10. It works from both cmd and Powershell. REPL also starts nicely in Cursive (IDEA plugin).

But when I open my leiningen project folder in VS Code with this extension - I see "Starting nREPL..." forever. There is nothing in console or terminal. There are no lein or java processes. IDEA is closed.

VS Code and plugin are the latest stable versions.

How do I debug further?

sly-x86 commented 6 years ago

Have the same issue. Here is my console output:

[Extension Host] nrepl stderr => WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by mranderson047.alembic.v0v3v3.dynapath.v0v2v5.dynapath.defaults$eval11588$fn11589 to method java.net.URLClassLoader.addURL(java.net.URL) WARNING: Please consider reporting this to the maintainers of mranderson047.alembic.v0v3v3.dynapath.v0v2v5.dynapath.defaults$eval11588$fn11589 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release (at Socket.nreplProcess.stderr.on.data (/Users/sly-x86/.vscode-insiders/extensions/avli.clojure-0.9.1/out/src/nreplController.js:50:21)) console.ts:123 [Extension Host] nrepl stderr => Exception in thread "main" (at Socket.nreplProcess.stderr.on.data (/Users/sly-x86/.vscode-insiders/extensions/avli.clojure-0.9.1/out/src/nreplController.js:50:21)) console.ts:123 [Extension Host] nrepl stderr => java.lang.RuntimeException: Unable to resolve var: refactor-nrepl.middleware/wrap-refactor in this context, compiling:(/private/var/folders/9g/hznymyjn00d8ymq1r7qc7s0h0000gn/T/form-init10646574868898445236.clj:1:9145) (at Socket.nreplProcess.stderr.on.data (/Users/sly-x86/.vscode-insiders/extensions/avli.clojure-0.9.1/out/src/nreplController.js:50:21)) console.ts:123 [Extension Host] nrepl stderr => at clojure.lang.Compiler.analyzeSeq(Compiler.java:6875) (at Socket.nreplProcess.stderr.on.data (/Users/sly-x86/.vscode-insiders/extensions/avli.clojure-0.9.1/out/src/nreplController.js:50:21)) console.ts:123 [Extension Host] nrepl stderr => at clojure.lang.Compiler.analyze(Compiler.java:6669) at clojure.lang.Compiler.analyze(Compiler.java:6625) at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3834) at clojure.lang.Compiler.analyzeSeq(Compiler.java:6870) (at Socket.nreplProcess.stderr.on.data (/Users/sly-x86/.vscode-insiders/extensions/avli.clojure-0.9.1/out/src/nreplController.js:50:21)) console.ts:123 [Extension Host] nrepl stderr => at clojure.lang.Compiler.analyze(Compiler.java:6669) at clojure.lang.Compiler.analyze(Compiler.java:6625) (at Socket.nreplProcess.stderr.on.data (/Users/sly-x86/.vscode-insiders/extensions/avli.clojure-0.9.1/out/src/nreplController.js:50:21)) console.ts:123 [Extension Host] nrepl stderr => at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3834) (at Socket.nreplProcess.stderr.on.data (/Users/sly-x86/.vscode-insiders/extensions/avli.clojure-0.9.1/out/src/nreplController.js:50:21)) console.ts:123 [Extension Host] nrepl stderr => at clojure.lang.Compiler.analyzeSeq(Compiler.java:6870) (at Socket.nreplProcess.stderr.on.data (/Users/sly-x86/.vscode-insiders/extensions/avli.clojure-0.9.1/out/src/nreplController.js:50:21)) console.ts:123 [Extension Host] nrepl stderr => at clojure.lang.Compiler.analyze(Compiler.java:6669) (at Socket.nreplProcess.stderr.on.data (/Users/sly-x86/.vscode-insiders/extensions/avli.clojure-0.9.1/out/src/nreplController.js:50:21)) console.ts:123 [Extension Host] nrepl stderr => at clojure.lang.Compiler.access$300(Compiler.java:38) (at Socket.nreplProcess.stderr.on.data (/Users/sly-x86/.vscode-insiders/extensions/avli.clojure-0.9.1/out/src/nreplController.js:50:21)) console.ts:123 [Extension Host] nrepl stderr => at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6269) at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868) at clojure.lang.Compiler.analyze(Compiler.java:6669) at clojure.lang.Compiler.analyze(Compiler.java:6625) at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6001) at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5380) at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3972) (at Socket.nreplProcess.stderr.on.data (/Users/sly-x86/.vscode-insiders/extensions/avli.clojure-0.9.1/out/src/nreplController.js:50:21)) console.ts:123 [Extension Host] nrepl stderr => at clojure.lang.Compiler.analyzeSeq(Compiler.java:6866) at clojure.lang.Compiler.analyze(Compiler.java:6669) at clojure.lang.Compiler.eval(Compiler.java:6924) at clojure.lang.Compiler.eval(Compiler.java:6917) at clojure.lang.Compiler.eval(Compiler.java:6917) at clojure.lang.Compiler.load(Compiler.java:7379) at clojure.lang.Compiler.loadFile(Compiler.java:7317) at clojure.main$load_script.invokeStatic(main.clj:275) at clojure.main$init_opt.invokeStatic(main.clj:277) (at Socket.nreplProcess.stderr.on.data (/Users/sly-x86/.vscode-insiders/extensions/avli.clojure-0.9.1/out/src/nreplController.js:50:21)) console.ts:123 [Extension Host] nrepl stderr => at clojure.main$init_opt.invoke(main.clj:277) at clojure.main$initialize.invokeStatic(main.clj:308) at clojure.main$null_opt.invokeStatic(main.clj:342) at clojure.main$null_opt.invoke(main.clj:339) at clojure.main$main.invokeStatic(main.clj:421) at clojure.main$main.doInvoke(main.clj:384) at clojure.lang.RestFn.invoke(RestFn.java:421) at clojure.lang.Var.invoke(Var.java:383) at clojure.lang.AFn.applyToHelper(AFn.java:156) at clojure.lang.Var.applyTo(Var.java:700) at clojure.main.main(main.java:37) (at Socket.nreplProcess.stderr.on.data (/Users/sly-x86/.vscode-insiders/extensions/avli.clojure-0.9.1/out/src/nreplController.js:50:21)) console.ts:123 [Extension Host] nrepl stderr => Caused by: java.lang.RuntimeException: Unable to resolve var: refactor-nrepl.middleware/wrap-refactor in this context at clojure.lang.Util.runtimeException(Util.java:221) at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:710) at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868) ... 37 more (at Socket.nreplProcess.stderr.on.data (/Users/sly-x86/.vscode-insiders/extensions/avli.clojure-0.9.1/out/src/nreplController.js:50:21)) console.ts:123 [Extension Host] nrepl stderr => REPL server launch timed out. (at Socket.nreplProcess.stderr.on.data (/Users/sly-x86/.vscode-insiders/extensions/avli.clojure-0.9.1/out/src/nreplController.js:50:21)) console.ts:123 [Extension Host] nREPL exit => 1 / Signal: null (at ChildProcess.nreplProcess.on (/Users/sly-x86/.vscode-insiders/extensions/avli.clojure-0.9.1/out/src/nreplController.js:53:21)) mainThreadExtensionService.ts:43 [avli.clojure]kill ESRCH e.$onExtensionRuntimeError @ mainThreadExtensionService.ts:43 e._doInvokeHandler @ rpcProtocol.ts:186 e._invokeHandler @ rpcProtocol.ts:171 e._receiveRequest @ rpcProtocol.ts:116 e._receiveOneMessage @ rpcProtocol.ts:91 (anonymous) @ rpcProtocol.ts:34 (anonymous) @ rpcProtocol.ts:231 e.fire @ event.ts:142 (anonymous) @ ipc.net.ts:81 emitOne @ events.js:96 emit @ events.js:191 readableAddChunk @ _stream_readable.js:178 Readable.push @ _stream_readable.js:136 onread @ net.js:560 mainThreadExtensionService.ts:44 Error: kill ESRCH at exports._errnoException (util.js:1050:11) at process.kill (internal/process.js:188:13) at stop (/Users/xsly/.vscode-insiders/extensions/avli.clojure-0.9.1/out/src/nreplController.js:72:21) at ChildProcess.nreplProcess.on (/Users/xsly/.vscode-insiders/extensions/avli.clojure-0.9.1/out/src/nreplController.js:54:13) at emitTwo (events.js:106:13) at ChildProcess.emit (events.js:194:7) at Process.__dirname.ChildProcess._handle.onexit (internal/child_process.js:215:12)

skaurus commented 6 years ago

Hi @sly-x86, I'm curious - do you see this in Output (Cmd-Shift-U), Debug console (Cmd-Shift-Y) or somewhere else?

sly-x86 commented 6 years ago

Hi @skaurus, Help -> Toggle Developer Tools

skaurus commented 6 years ago

Thanks!

That's what I see there:

[Extension Host] nrepl stderr => 2018-01-10 21:48:17.276:INFO::main: Logging initialized @3177ms

console.ts:123 [Extension Host] nrepl stderr => WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: mranderson047.toolsanalyzerjvm.v0v6v9.toolsanalyzer.v0v6v7.clojure.tools.analyzer.utils, being replaced by: #'mranderson047.toolsanalyzerjvm.v0v6v9.toolsanalyzer.v0v6v7.clojure.tools.analyzer.utils/boolean?

console.ts:123 [Extension Host] nrepl stderr => WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: mranderson047.toolsanalyzerjvm.v0v6v9.toolsanalyzer.v0v6v7.clojure.tools.analyzer, being replaced by: #'mranderson047.toolsanalyzerjvm.v0v6v9.toolsanalyzer.v0v6v7.clojure.tools.analyzer.utils/boolean?

console.ts:123 [Extension Host] nrepl stderr => WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: cljs.util, being replaced by: #'cljs.util/boolean?

console.ts:123 [Extension Host] nrepl stderr => Exception in thread "main" 
console.ts:123 [Extension Host] nrepl stderr => java.lang.RuntimeException: Unable to resolve var: cider.nrepl.middleware.test/wrap-test in this context, compiling:(C:\Users\Skaurus\AppData\Local\Temp\form-init5143848397107376053.clj:1:10110)

console.ts:123 [Extension Host] nrepl stderr =>     at clojure.lang.Compiler.analyzeSeq(Compiler.java:7010)
    at clojure.lang.Compiler.analyze(Compiler.java:6773)

console.ts:123 [Extension Host] nrepl stderr =>     at clojure.lang.Compiler.analyze(Compiler.java:6729)
    at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3881)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7005)
    at clojure.lang.Compiler.analyze(Compiler.java:6773)
    at clojure.lang.Compiler.analyze(Compiler.java:6729)
    at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3881)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7005)
    at clojure.lang.Compiler.analyze(Compiler.java:6773)

console.ts:123 [Extension Host] nrepl stderr =>     at clojure.lang.Compiler.access$300(Compiler.java:38)
    at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6368)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7003)
    at clojure.lang.Compiler.analyze(Compiler.java:6773)
    at clojure.lang.Compiler.analyze(Compiler.java:6729)
    at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6100)
    at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5460)
console.ts:123 [Extension Host] nrepl stderr => 
    at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4022)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7001)
    at clojure.lang.Compiler.analyze(Compiler.java:6773)
    at clojure.lang.Compiler.eval(Compiler.java:7059)
    at clojure.lang.Compiler.eval(Compiler.java:7052)
    at clojure.lang.Compiler.eval(Compiler.java:7052)
    at clojure.lang.Compiler.load(Compiler.java:7514)

console.ts:123 [Extension Host] nrepl stderr =>     at clojure.lang.Compiler.loadFile(Compiler.java:7452)
    at clojure.main$load_script.invokeStatic(main.clj:278)
    at clojure.main$init_opt.invokeStatic(main.clj:280)
    at clojure.main$init_opt.invoke(main.clj:280)
    at clojure.main$initialize.invokeStatic(main.clj:311)
    at clojure.main$null_opt.invokeStatic(main.clj:345)
    at clojure.main$null_opt.invoke(main.clj:342)
console.ts:123 [Extension Host] nrepl stderr => 
    at clojure.main$main.invokeStatic(main.clj:424)
    at clojure.main$main.doInvoke(main.clj:387)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.lang.Var.applyTo(Var.java:702)
    at clojure.main.main(main.java:37)

console.ts:123 [Extension Host] nrepl stderr => Caused by: java.lang.RuntimeException: Unable to resolve var: cider.nrepl.middleware.test/wrap-test in this context
    at clojure.lang.Util.runtimeException(Util.java:221)
console.ts:123 [Extension Host] nrepl stderr => 
    at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:720)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7003)
    ... 35 more

console.ts:123 [Extension Host] nrepl stderr => REPL server launch timed out.

console.ts:123 [Extension Host] nREPL exit => 1 / Signal: null
console.ts:123 [Extension Host] rejected promise not handled within 1 second
t.log @ console.ts:123
t._logExtensionHostMessage @ extensionHost.ts:391
(anonymous) @ extensionHost.ts:211
emitTwo @ events.js:106
emit @ events.js:194
process.nextTick @ internal/child_process.js:766
_combinedTickCallback @ internal/process/next_tick.js:73
_tickCallback @ internal/process/next_tick.js:104
mainThreadExtensionService.ts:43 [avli.clojure]Cannot match against 'undefined' or 'null'.
e.$onExtensionRuntimeError @ mainThreadExtensionService.ts:43
e.invoke @ abstractThreadService.ts:42
e._invokeHandler @ rpcProtocol.ts:109
e._receiveOneMessage @ rpcProtocol.ts:96
(anonymous) @ rpcProtocol.ts:32
(anonymous) @ rpcProtocol.ts:157
e.fire @ event.ts:142
(anonymous) @ ipc.net.ts:81
emitOne @ events.js:96
emit @ events.js:191
readableAddChunk @ _stream_readable.js:178
Readable.push @ _stream_readable.js:136
onread @ net.js:560
mainThreadExtensionService.ts:44 TypeError: Cannot match against 'undefined' or 'null'.
    at nreplController_1.nreplController.start.then.then.then.then.catch (C:\Users\Skaurus\OneDrive\vscode settings\.vscode\extensions\avli.clojure-0.9.1\out\src\cljConnection.js:103:16)
    at <anonymous>
4350pChris commented 6 years ago

Same problem here with the exact same error message, however, manually connecting to a running repl works. OS is Antergos in case that makes any difference.

skaurus commented 6 years ago

It may be related to Clojure version. I have 1.9.0. See https://github.com/clojure-emacs/cider/issues/2081

robert914 commented 6 years ago

I can confirm, Clojure 1.9.0 does not work with this. Mine was hanging as well, and I switched my project back to Clojure 1.8.0, and the nREPL starts now. FWIW.

Extension needs to be upgraded to use at least [cider/cider-nrepl "0.15.1"] for Clojure 1.9.0 to work. It currently is using [cider/cider-nrepl "0.15.0-SNAPSHOT"].

Interesting, I added [cider/cider-nrepl "0.16.0"] to my :user profile :plugins list, and now the nREPL will start. It must be overriding the one that this extension is trying to load from the command-line:

"lein update-in :dependencies conj [org.clojure/tools.nrepl "0.2.12" :exclusions [org.clojure/clojure]] -- update-in :dependencies conj [cljfmt "0.5.7"] -- update-in :plugins conj [refactor-nrepl "2.3.0-SNAPSHOT"] -- update-in :plugins conj [cider/cider-nrepl "0.15.0-SNAPSHOT"] -- repl"

avli commented 6 years ago

The new version that updates the dependencies was released. Please check if it fixes the issue for you, guys.

skaurus commented 6 years ago

Yep, fixed it for me. Thanks!