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

v2.0.210: Jack-In with fixed deps.edn + shadow-cljs fails starting cljs REPL #1285

Open
real-iceman opened this issue Aug 31, 2021 · 11 comments
Labels

Comments

@real-iceman
Copy link

I'm trying to use the recently re-added jack-in configuration deps.edn + shadow.-cljs. This fails with message

Failed starting cljs repl for build: :workspaces. Is the build running and connected?,

unfortunately withount any hint in the Calva Connection Log (sometimes I get Socket closed). CLJ REPL is active, but no CLJS REPL has been started.

Configuration shadow-cljs seems to work fine and starts cljs REPL as expected.

I'm using VSCode 1.59.1 Windows 10 / WSL2. Already deactivated all other extensions. Also tried a fresh VSCode + Calva install in a Linux VM, but same result.

Problem can be reproduced using fulcro-template:

git clone https://github.com/fulcrologic/fulcro-template
cd fulcro-template
yarn install

Then, open folder in VSCode and jack-in using configuration deps.edn + shadow-cljs, alias :dev and build :workspaces.

Maybe I'm just doing it wrong as I am quite new to Clojurescript and Calva? Which, btw, seems to be a great extension!

@bpringe
Copy link
Member

bpringe commented Aug 31, 2021

@real-iceman Thanks for the report and reproduction steps.

Pinging @PEZ.

@PEZ
Copy link
Collaborator

PEZ commented Aug 31, 2021

@real-iceman does it work without the :workspaces build? (Not suggesting you should be running without it, rather trying to figure out where things go wrong.)

@real-iceman
Copy link
Author

@PEZ Thanks for replying so quickly!

I tried also :main build, but unfortunately it's the same result.

Is there a way to trace what happens behind the scenes?

@bpringe
Copy link
Member

bpringe commented Sep 1, 2021

@real-iceman You can check the developer tools console for any errors. Help -> Toggle Developer Tools -> Console

@real-iceman
Copy link
Author

@bpringe In the devtools console I can see two errors and a warning at VSCode startup, but no new messages from the jack-in process.

grafik

@bpringe
Copy link
Member

bpringe commented Sep 4, 2021

I tried to follow the quick start in the project readme and when I run npx shadow-cljs server I get the following error:

shadow-cljs - config: /Users/brandon/development/fulcro-template/shadow-cljs.edn
shadow-cljs - starting via "clojure"
WARNING: Implicit use of clojure.main with options is deprecated, use -M
Execution error (UnsatisfiedLinkError) at java.lang.ClassLoader$NativeLibrary/load0 (ClassLoader.java:-2).
/private/var/folders/9g/s52593k52h7g6r6jc54g_p7m0000gn/T/jna16528589360030829895.tmp: dlopen(/private/var/folders/9g/s52593k52h7g6r6jc54g_p7m0000gn/T/jna16528589360030829895.tmp, 1): no suitable image found.  Did find:
        /private/var/folders/9g/s52593k52h7g6r6jc54g_p7m0000gn/T/jna16528589360030829895.tmp: no matching architecture in universal wrapper
        /private/var/folders/9g/s52593k52h7g6r6jc54g_p7m0000gn/T/jna16528589360030829895.tmp: no matching architecture in universal wrapper

Full report at:
/var/folders/9g/s52593k52h7g6r6jc54g_p7m0000gn/T/clojure-15086078284734753662.edn

I'm not sure if that's something odd going on with my machine (mac with the newish M1 chip). Does this happen for you? @PEZ might be able to help further here.

@bpringe
Copy link
Member

bpringe commented Sep 4, 2021

I do get the same error at jack-in as you, but now I'm unsure if it's due to the same reason.

@bpringe
Copy link
Member

bpringe commented Sep 4, 2021

Ok I solved that error above by using a workaround mentioned here, but jack-in still fails for me as it does for you.

Are you able to run this project in development mode using the instructions in the readme (without Calva's jack-in)?

@real-iceman
Copy link
Author

Yes, I can successfully run npx shadow-cljs server and then connect in Calva.

In the meantime, I have updated VSCode and Calva to 1.60.0 / 2.0.211 but this had no impact on jack-in via deps.edn + shadow-cljs.

@bpringe
Copy link
Member

bpringe commented Sep 6, 2021

So jack-in by itself in this case does not start a shadow-cljs build. This is the command it issues when choosing deps.edn + shadow-cljs:

clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"0.8.3"},cider/cider-nrepl {:mvn/version,"0.26.0"}}}' -A:dev -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"

So, when you try to connect to the :workspaces build via the menu, it fails because that build isn't running.

I don't use this jack-in type, so I'm not sure what should be done in this case to use jack-in to run and connect to the :workspaces build, or if this is something that's supposed to be possible, but maybe @PEZ can provide more info.

@agoldhammer
Copy link
Contributor

I have also encountered this problem, which I think has to do with the wrong path being used with WSL2. If I start VSCode from a Linux shell with the command code ., Calva can find npx, but if I start VSCode by double-clicking in Windows and then opening a remote WSL:Ubuntu window, npx is not found. This was not the case in the past, if I remember correctly, but I'm not sure which Calva build caused it to fail. If I start shadow-cljs in the shell, I can "Connect to running REPL in project" with no problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants