Fork me on GitHub
#cider
<
2022-02-17
>
Drew Verlee07:02:15

How do you pass a clojure deps alias in a dir-locals file to a shadow-cljs project. Here is what i'm trying and its not working

((nil . (
         (cider-preferred-build-tool . shadow-cljs)
         (cider-clojure-cli-aliass . "-A:dev") <-------
         (cider-default-cljs-repl . shadow)
         (cider-shadow-default-options . "dev")
         (cider-shadow-watched-builds . ("dev" "cards"))
         )))

Sampo Toiva10:02:36

@U0DJ4T5U1 cider-clojure-cli-aliass should be cider-clojure-cli-aliases and you should also omit the -A. So, something like (cider-clojure-cli-aliases . ":dev") should do the trick.

Sampo Toiva10:02:37

And actually, in your case, you probably want to use something like (cider-clojure-cli-global-options . "-A:dev") since the cider-clojure-cli-aliases apply to my knowledge to starting the repl with clojure-cli Check this for more info: https://docs.cider.mx/cider/cljs/shadow-cljs.html#using-shadow-cljs-with-deps-edn-and-custom-repl-initialization

practicalli-johnny11:02:58

Fro reference, there are several variables for Cider shadow-cljs https://practical.li/spacemacs/reference/cider/configuration-variables.html#ciderel

👀 1
👍 1
Drew Verlee04:02:48

thanks @UFG0HRDC7 and @U05254DQM those suggestions worked, i'm embarrassed i didn't notice the typo in my original attempt.

Sampo Toiva05:02:12

No worries, not the first nor the last time someone (me included) typos something and wonders why it doesn’t work :)

Drew Verlee05:02:45

I need a faster way to understand the code i'm putting in those dir-local files. i spend way to much time messing with them. I need to learn elisp and probably just stop using them in the way I am, or something.

practicalli-johnny09:02:20

https://exercism.org/ has an Emacs Lisp learning track

👀 1
winsome16:02:04

I'm trying to start a cljs node repl and it opens up a cljs repl but fails when it tries to run (cider.piggieback/cljs-repl (cljs.repl.node/repl-env)), with this stacktrace:

TypeError: Cannot read properties of undefined (reading 'error__GT_str')
    at Socket.<anonymous> ([stdin]:89:38)
    at Socket.emit (node:events:390:28)
    at Socket.emit (node:domain:475:12)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:285:11)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:199:23)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)

winsome16:02:47

I can get browser repl going, but I'm not sure where to start debugging this one.

Akshay C. Gollapalli22:02:51

does cider attempt to launch repls under a different user or in a different environment than the one emacs is running under? (on linux)

dpsutton22:02:10

emacs does have a different exec-path from the env of the launching shell, especially when started as a GUI frame not as a child of a terminal

dpsutton22:02:07

what error are you seeing?

Akshay C. Gollapalli22:02:31

I'm having issues with cider running figwheel-main with npm dependencies coming from webpack. It's not able to find node, installed via nvm. When I run the figwheel-main via clojure -m figwheel.main -b dev -r it works fine. But running from the major mode in emacs returns

[Figwheel:SEVERE] Bundling command failed /usr/bin/env: 'node': No such file or directory

dpsutton22:02:03

yeah. i’ve had issues with this in the past. in my init i had to add the nvm location to the exec-path.

dpsutton22:02:39

you can test out by opening an eshell buffer and typing which node. If that doesn’t work no emacs child process will. You’ll need to add to the exec-path so it can find node

👍 1
dpsutton22:02:46

exec-path is a variable defined in 'C source code'.
Its value is
("/Users/dan/.sdkman/candidates/java/current/bin/" "/Users/dan/bin/" "/opt/homebrew/bin/" "/opt/homebrew/sbin/" "/usr/local/bin/" "/usr/bin/" "/bin/" "/usr/sbin/" "/sbin/" "/opt/homebrew/Cellar/emacs-mac/emacs-27.2-mac-8.3/libexec/emacs/27.2/aarch64-apple-darwin21.2.0/")

[truncated]

Documentation:
List of directories to search programs to run in subprocesses.
Each element is a string (directory name) or nil (try default directory).

By default the last element of this list is 'exec-directory'. The
last element is not always used, for example in shell completion
('shell-dynamic-complete-command').

dpsutton22:02:04

not sure if nvm does something similar to sdkman there where java/current/bin is on my exec-path

dpsutton22:02:27

and of course this helpful lib if you aren’t already using it

Akshay C. Gollapalli22:02:31

I remembered that doom actually lets you alter your env. So I ran doom env, but I didnt' realize that it was by frame. Restarting emacs after adding an environment file did the trick!

🎉 1