mauricioszabo / atom-chlorine

An Atom plugin to integrate with Socket-REPL over Clojure, ClojureScript, ClojureCLR, Joker, Babashka, Clojerl, Lumo and Plank
MIT License
176 stars 17 forks source link

REPL not connected for ClojureScript. You can connect a REPL using 'Connect Socket REPL' command, or 'Connect Embedded' command #217

Closed rtacconi closed 4 years ago

rtacconi commented 4 years ago

Hi,

I am using Chlorine 0.9.4. I have an app Clojure app using deps.edn and shadow-cljs. This is the shadow-cljs.edn )it is in the root of the project:

{:source-paths ["src"]

 :dependencies [[binaryage/devtools "0.9.10"]
                [reagent "0.8.1"]
                [cljs-http "0.1.46"]]
 :dev-http {8080 "resources/public"}
 :builds
 {:app
   {:target :browser
        :output-dir "resources/public/js"
        :asset-path "/js"
        :modules
        {:main {:entries [app.core]}}
        }}}

The project structure is this:

├── LICENSE.md
├── README.md
├── deps.edn
├── node_modules
│   ├── asap
│   ├── asn1.js
...
│   └── xtend
├── package.json
├── resources
│   └── public
├── shadow-cljs.edn
├── shell.nix
└── src
    ├── app
    └── rtacconi

rtacconi directory has a compojure config to serve index.html and expose a JSON endpoint. app directory is where I have a reagent app.

I use the Clojure app in the REPL easily. However, I tried connect to REPL and connect embedded and I always get the error reported on the subject above.

mauricioszabo commented 4 years ago

Ok, let see: you're starting a Clojure socket REPL with clj command and then connecting to it? Or are you starting a shadow-cljs "watch" process and then connecting to the port that Chlorine auto detects for you?

If it's the former, it's probably what's wrong. Chlorine (currently - I'm looking for alternatives) only connects to a single "Clojure" REPL, and in this case, it's the REPL that's started from clj. If you connect to the REPL that's started from shadow-cljs it will probably work.

Just to be sure: when you run Connect embedded, no error message appears?

rtacconi commented 4 years ago

I made the repo public https://github.com/jacekschae/shadow-reagent.git. I start Clojure with clj -A:socket which is an alias taken from https://github.com/seancorfield/dot-clojure/blob/master/deps.edn. I connect to the repl with Chlorine, evaluate the code and serve the assets, this is the code: https://github.com/rtacconi/logic-rad/blob/master/src/rtacconi/comp.clj.

Then I run shadow-cljs watch app start Chlorine which autodetects the port, then connect embedded and I try to run (+ 1 1) from here https://github.com/rtacconi/logic-rad/blob/master/src/app/core.cljs or views.cljs but I get that error.

So it looks like it connects, but when I run the code it tells me:

REPL not connected for ClojureScript. You can connect a REPL using 'Connect Socket REPL' command, or 'Connect Embedded' command

I hope I am clear. Thanks for your help. I love Chlorine, it's the best REPL for Atom.

mauricioszabo commented 4 years ago

@rtacconi were you able to figure out the problem?

rtacconi commented 4 years ago

No I gave up, I have no idea why it is not working, I get no extra info.