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

Getting stuck on "adding middlewares" #43

Closed
eneroth opened this issue Dec 14, 2021 · 9 comments
Closed

Getting stuck on "adding middlewares" #43

eneroth opened this issue Dec 14, 2021 · 9 comments

Comments

@eneroth
Copy link

eneroth commented Dec 14, 2021

I'm attempting to connect to a server hosted by Shadow-CLJS:

{:deps        {:aliases [:common]}
 :nrepl       {:port       5555
               :middleware []}
 …}

There are no error messages in the log, as I can see.

Screenshot 2021-12-14 at 10 54 57

@jaihindhreddy
Copy link
Contributor

Please make sure you are using nrepl version 0.8 or later.
I faced this issue when I used a very old version of nrepl.

@eneroth
Copy link
Author

eneroth commented Dec 14, 2021

Ah, I have no idea which REPL is included in Shadow-CLJS. It might be an old one, I guess.

Edit: it seems that Shadow-CLJS is using 0.8.3.

@tonsky
Copy link
Owner

tonsky commented Dec 14, 2021

I have never tested with CLJS. There are a few middlewares which are clojure-native, not sure how it goes with CLJS REPL. If you can figure out what’s going on and what’s needed to make CLJS tick, it would be a great help. See also #31

@eneroth
Copy link
Author

eneroth commented Dec 14, 2021

Shadow-CLJS exposes a normal CLJ socket REPL as well as an NREPL, so I'm not connecting to CLJS. I've never bothered running a socket or NREPL separately, seeing as Shadow provides one: https://shadow-cljs.github.io/docs/UsersGuide.html#_clojure_repl

Once connected to the CLJ REPL, it's possible to tunnel into the CLJS one.

@sepisoad
Copy link

I'm also suffering from the same issue

@alekzvik
Copy link

TL;DR shadow-cljs implements nrepl protocol for v0.4. Clojure Sublimed expects at least 0.8.

I encountered the same issue. After I turned the debug: True, I noticed that shadow-cljs's nrepl replies with unknown-op

A few hours later, I found out that shadow-cljs redefines middlewares for nrepl and requires them one by one here
This piece of code was introduced for nrepl version 0.4, and after comparing to the list in v1.0.0, I found four middlewares are missing. One of them is a middleware to add middlewares that Clojure Sublimed wants to use. I tried patching shadow-cljs, but no luck so far - I am stuck on this error.

I will post an update if I resolve this, but I wanted to share my findings anyway to save time for the next person trying to figure it out.

@tonsky
Copy link
Owner

tonsky commented Aug 25, 2022

Thanks @alekzvik! Another angle of attack might be for Clojure Sublimed to not require extra middlewares for CLJS

@alekzvik
Copy link

@tonsky, or they can be optional. A describe op can return a list of supported operations from the nREPL server.
This approach might also be helpful in #29

@tonsky
Copy link
Owner

tonsky commented Oct 17, 2022

Should work in 2.8.0 via Connect shadow-cljs command

@tonsky tonsky closed this as completed Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants