Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEBUG: unknown status need-input when trying to REPL ClojureScript #358

Closed
wilkerlucio opened this issue May 7, 2014 · 14 comments
Closed
Labels
released Marks issues which have had the fixes released in a stable build
Milestone

Comments

@wilkerlucio
Copy link

Hi, I'm trying to REPL my browser, and I do like I do on the terminal, first I launch the default REPL and go with:

(require 'cljs.repl)
(require 'cljs.repl.browser)
(cljs.repl/repl (cljs.repl.browser/repl-env))

When I do that it correct starts the REPL server, the browser is able to connect, but I'm unable to send any other commands after that... here follows an example (a new unknow status input happens everytime I try to Interrupt the Current execution)

Starting nREPL server...
/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/bin/java -Dclojure.compile.path=/Users/wilkerlucio/Development/sm2/smgui/target/classes -Dsmgui.version=0.0.1-SNAPSHOT -Dfile.encoding=UTF-8 -Dclojure.debug=false -Didea.launcher.port=7534 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 13 CE.app/bin" -classpath "/Users/wilkerlucio/Development/sm2/smgui/test:/Users/wilkerlucio/Development/sm2/smgui/src/clj:/Users/wilkerlucio/Development/sm2/smgui/src/cljs:/Users/wilkerlucio/Development/sm2/smgui/dev-resources:/Users/wilkerlucio/Development/sm2/smgui/resources:/Users/wilkerlucio/Development/sm2/smgui/target/classes:/Users/wilkerlucio/.m2/repository/org/clojure/core.async/0.1.301.0-deb34a-alpha/core.async-0.1.301.0-deb34a-alpha.jar:/Users/wilkerlucio/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar:/Users/wilkerlucio/.m2/repository/args4j/args4j/2.0.16/args4j-2.0.16.jar:/Users/wilkerlucio/.m2/repository/org/clojure/core.memoize/0.5.6/core.memoize-0.5.6.jar:/Users/wilkerlucio/.m2/repository/org/clojure/core.cache/0.6.3/core.cache-0.6.3.jar:/Users/wilkerlucio/.m2/repository/org/ow2/asm/asm-all/4.1/asm-all-4.1.jar:/Users/wilkerlucio/.m2/repository/org/clojure/data.json/0.2.3/data.json-0.2.3.jar:/Users/wilkerlucio/.m2/repository/org/clojure/tools.reader/0.8.3/tools.reader-0.8.3.jar:/Users/wilkerlucio/.m2/repository/com/google/protobuf/protobuf-java/2.4.1/protobuf-java-2.4.1.jar:/Users/wilkerlucio/.m2/repository/com/facebook/react/0.9.0.1/react-0.9.0.1.jar:/Users/wilkerlucio/.m2/repository/org/clojure/clojurescript/0.0-2202/clojurescript-0.0-2202.jar:/Users/wilkerlucio/.m2/repository/om/om/0.6.2/om-0.6.2.jar:/Users/wilkerlucio/.m2/repository/org/clojure/data.priority-map/0.0.2/data.priority-map-0.0.2.jar:/Users/wilkerlucio/.m2/repository/org/clojure/tools.analyzer.jvm/0.1.0-beta12/tools.analyzer.jvm-0.1.0-beta12.jar:/Users/wilkerlucio/.m2/repository/org/clojure/tools.nrepl/0.2.3/tools.nrepl-0.2.3.jar:/Users/wilkerlucio/.m2/repository/org/clojure/google-closure-library/0.0-20140226-71326067/google-closure-library-0.0-20140226-71326067.jar:/Users/wilkerlucio/.m2/repository/org/clojure/google-closure-library-third-party/0.0-20140226-71326067/google-closure-library-third-party-0.0-20140226-71326067.jar:/Users/wilkerlucio/.m2/repository/org/clojure/clojure/1.6.0/clojure-1.6.0.jar:/Users/wilkerlucio/.m2/repository/org/mozilla/rhino/1.7R4/rhino-1.7R4.jar:/Users/wilkerlucio/.m2/repository/clojure-complete/clojure-complete/0.2.3/clojure-complete-0.2.3.jar:/Users/wilkerlucio/.m2/repository/org/clojure/tools.analyzer/0.1.0-beta12/tools.analyzer-0.1.0-beta12.jar:/Users/wilkerlucio/.m2/repository/org/json/json/20090211/json-20090211.jar:/Users/wilkerlucio/.m2/repository/com/google/javascript/closure-compiler/v20131014/closure-compiler-v20131014.jar:/Users/wilkerlucio/.m2/repository/com/google/guava/guava/15.0/guava-15.0.jar:/Applications/IntelliJ IDEA 13 CE.app/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain clojure.main -i /private/var/folders/nb/m18105410nz_xkx4qkd98h_c0000gn/T/form-init538705581472232192.clj
Connecting to local nREPL server...
Clojure 1.6.0
nREPL server started on port 61891 on host 127.0.0.1
(do
    (require 'cljs.repl)
    (require 'cljs.repl.browser)
    (cljs.repl/repl (cljs.repl.browser/repl-env)))
WARNING: unsigned-bit-shift-right already refers to: #'clojure.core/unsigned-bit-shift-right in namespace: cljs.core, being replaced by: #'cljs.core/unsigned-bit-shift-right
To quit, type: :cljs/quit
ClojureScript:cljs.user> DEBUG: unknown status need-input
(.alert js/window "test")
Evaluation interrupted.
nil
ClojureScript:cljs.user> DEBUG: unknown status need-input
nil
ClojureScript:cljs.user> DEBUG: unknown status need-input
Evaluation interrupted.
@cursive-ide
Copy link
Owner

Hmm, that's interesting - I suspect this is an artefact of how the CLJS REPL works. That status means that the REPL server is asking for input from in, which isn't currently supported. I'll take a look at this, I'm fixing a bunch of CLJS issues for the next release.

@CRHough
Copy link

CRHough commented Aug 15, 2014

The same with (clojure.main/repl).

Code from http://crossclj.info/ns/marosoft-clj/latest/marosoft.debug.html

Works fine from lein repl but not in Cursive.

@djova
Copy link

djova commented Sep 17, 2014

You can use piggieback to launch a cljs repl on top of an nREPL session! This currently works with the Cursive clojure plugin in IntelliJ.

@gphilipp
Copy link

I type this once I've started a regular REPL and it works perfectly :

(require 'weasel.repl.websocket)

(cemerick.piggieback/cljs-repl
        :repl-env (weasel.repl.websocket/repl-env
                   :ip "0.0.0.0" :port 9001))

then in your cljs file :

(ns my.cljs.core
  (:require [weasel.repl :as ws-repl]))

(ws-repl/connect "ws://localhost:9001" :verbose true)

It's all explained here : https://github.com/tomjakubowski/weasel

@wilkerlucio
Copy link
Author

Just for reference, today I saw this video from Tim Baldridge: https://tbaldridge.pivotshare.com/media/cursive-and-clojurescript/12952

It's not free, but it's nice content (as the rest of the videos, it worth it). So, if someone else gets into this trouble, I recommend this video.

@mfikes
Copy link

mfikes commented Feb 18, 2015

@cursiveclojure It might be possible for Cursive to support input with nREPL. The reason: If you run lein repl, then you can read:

user=> (read-line)
x
"x"

and in this case REPL-y is being used with nREPL, if I am understanding correctly from the prelude when starting lein repl:

nREPL server started on port 56384 on host 127.0.0.1 - nrepl://127.0.0.1:56384
REPL-y 0.3.1`

This may have to do with this bit of code in REPL-y properly handling this bit of code in nREPL.

These are all just guesses. I'm thinking "if REPL-y can support reading from *in* when connected to nREPL, then perhaps Cursive's REPL can also."

@cursive-ide
Copy link
Owner

Yes, it's definitely possible, I've just never got around to doing it. There's some trickiness around how to get that input (a popup? Or remove the restriction that input should be a valid form before sending it?), but it's all solvable. I'll try to do this soon.

@gphilipp
Copy link

Hi Colin, I'm just being bitten by this issue. I've followed @mfikes tutorial for using Om with React Native, and I can't use Cursive's REPL (local or remote) to accept a valid input when choosing the device (it works with a command line repl). That's so frustrating :-)

@mfikes
Copy link

mfikes commented Jun 18, 2015

@gphilipp
Copy link

Thanks @mfikes, both options work beautifully, i just had to update the commands for the second option to

(require
    '[cljs.repl :as repl]
    '[cemerick.piggieback]
    '[ambly.core :as ambly])

and

(cemerick.piggieback/cljs-repl
  (ambly.core/repl-env :choose-first-discovered true))

Great work btw !

@mfikes
Copy link

mfikes commented Jun 18, 2015

@gphilipp Thanks. Updated the Ambly Wiki.

@gphilipp
Copy link

You're welcome. I've noticed another typo in this page, (ns awesome-project.core) is defined twice in the cljs file.

@gphilipp
Copy link

For posterity, Mike replied on twitter that it was on purpose.

@leeorengel
Copy link

+1

@cursive-ide cursive-ide added this to the 1.4.0-eap1 milestone Jul 27, 2016
@cursive-ide cursive-ide added the released Marks issues which have had the fixes released in a stable build label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Marks issues which have had the fixes released in a stable build
Projects
None yet
Development

No branches or pull requests

8 participants