This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-18
Channels
- # announcements (26)
- # beginners (107)
- # calva (26)
- # cider (55)
- # clj-kondo (7)
- # clojure (115)
- # clojure-europe (6)
- # clojure-houston (3)
- # clojure-italy (4)
- # clojure-nl (16)
- # clojure-norway (1)
- # clojure-uk (42)
- # clojuredesign-podcast (3)
- # clojurescript (47)
- # clojutre (4)
- # cursive (7)
- # datomic (75)
- # fulcro (1)
- # graalvm (3)
- # graphql (16)
- # jobs (1)
- # jobs-discuss (13)
- # keechma (1)
- # leiningen (19)
- # luminus (5)
- # off-topic (33)
- # pathom (16)
- # re-frame (76)
- # reitit (4)
- # ring (5)
- # shadow-cljs (86)
- # spacemacs (52)
- # tools-deps (43)
- # vim (7)
- # yada (1)
guys, how can I use cider with shadow-cljs node-repl?
I'm having some problems on the repl recognizing deps
that was related to this
shadow-cljs.edn
{:deps true
:builds {:cloud-function {:target :node-library
:main firstfunction.firstfunction.foo/hello
:output-to "index.js"
:compiler-options {:optimizations :simple}
:exports-var firstfunction.firstfunction.foo/exports}
:test {:target :node-test
:output-to "target/firstfunction.firstfunction.js"
:compiler-options {:optimizations :simple}
:autorun true}
}}
deps.edn
{:paths ["resources" "src"]
:deps {org.clojure/clojure {:mvn/version "1.10.1"}
org.clojure/clojurescript {:mvn/version "1.10.520"}
org.clojure/core.async {:mvn/version "0.4.500"}
org.clojure/tools.logging {:mvn/version "0.5.0"}
ch.qos.logback/logback-classic {:mvn/version "1.2.3"}
tick {:mvn/version "0.4.17-alpha"}
com.lucasbradstreet/cljs-uuid-utils {:mvn/version "1.0.2"}
cljs-bean {:mvn/version "1.3.0"}
thheller/shadow-cljs {:mvn/version "2.8.51"}
funcool/promesa {:mvn/version "2.0.1"}}
:aliases {:test {:extra-paths ["test"]
:extra-deps {org.clojure/test.check {:mvn/version "0.10.0-RC1"}}}
:main-opts ["-m" "cognitect.test-runner" "-d" "test"]}
:build-cloud-function {:main-opts ["-m" "shadow.cljs.devtools.cli" "compile" "cloud-function"]}}}
when I try
M-x cider-jack-in-cljs
using shadow-cljs it gives me:
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: env: node: No such file or directory
I've added on emacs path the nvm path
to execute
and when I connect from an external repl initialized on a terminal I can't require mine dependencies
What command do you run from a repl and what error message or behavior do you observe when you connect
[nREPL] Starting server via /home/ianffcs/.nvm/versions/node/v12.10.0/bin/npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.1 -d refactor-nrepl:2.5.0-SNAPSHOT -d cider/cider-nrepl:0.22.0-beta8 -d nubank/midje-nrepl:1.2.0-SNAPSHOT server error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: /usr/bin/env: “node”: unexistent directory or archive error in process sentinel: Could not start nREPL server: /usr/bin/env: “node”: unexistent directory or archive
i'm heading to bed so most likely culprits:
1. when starting from the repl. you aren't including the necessary cider-nrepl middleware. Do another jack-in-cljs and see the startup command used (it can be found in *Messages*
) and connect to a shadow started from the terminal with that same startup command
2. you still don't have npx on the exec-path for emacs. try running (shell-command-to-string "which npx")
. If it returns nil or some kind of message saying no command is found, you need to keep going. I used to use nvm but it didn't play nicely with emacs so i switched to a more traditional installation method
[nREPL] Starting server via /home/ianffcs/.nvm/versions/node/v12.10.0/bin/npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.1 -d refactor-nrepl:2.5.0-SNAPSHOT -d cider/cider-nrepl:0.22.0-beta8 -d nubank/midje-nrepl:1.2.0-SNAPSHOT server error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: /usr/bin/env: “node”: unexistent directory or archive error in process sentinel: Could not start nREPL server: /usr/bin/env: “node”: unexistent directory or archive
this are in messages buffer
i think i ran into this with a custom installation directory and shadow expects node to be at /usr/bin/env
. Not sure. that's just guess and hazy recollectoin
$which node
gives me/home/ianffcs/.nvm/versions/node/v12.10.0/bin/node
maybe I'll make some symbolic links on bin?
my symbolic links worked
kinda sad if I have to upgrade nvm
Syntax error (FileNotFoundException) compiling at (src/firstfunction/firstfunction/foo.cljs:1:1).
Could not locate cljs_bean/core__init.class, cljs_bean/core.clj or cljs_bean/core.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
now it's giving this when I try to load the namespace
that was related to this
(ns firstfunction.firstfunction.foo
(:require
[cljs-bean.core :refer [bean ->clj ->js]]))
here, yes
I rerun the repl and it's like these now
also, when I load the buffer
it's eternal loading =<
yeah, I thought it would be something like this
thanks 😃
I'll try to load that stuff on IntelliJ for now =<
I did it @dpsutton!
https://andrearichiardi.com/blog/posts/clojurescript-cursive-shadow-setup.html => We need to run that JavaScript file in the node runtime in order to get to our REPL, therefore we run in a terminal ...
@malch Currently that’s not possible, but if you submit a bug report probably @robertkrahn is going to address it pretty quickly.