This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-21
Channels
- # aws (2)
- # bangalore-clj (1)
- # beginners (25)
- # boot (2)
- # cider (176)
- # clara (73)
- # cljs-dev (6)
- # cljsrn (31)
- # clojure (40)
- # clojure-greece (9)
- # clojure-india (1)
- # clojure-italy (14)
- # clojure-nl (9)
- # clojure-russia (4)
- # clojure-uk (156)
- # clojurescript (124)
- # core-async (37)
- # cursive (2)
- # data-science (2)
- # datomic (22)
- # emacs (3)
- # fulcro (32)
- # graphql (6)
- # java (3)
- # lein-figwheel (19)
- # lumo (29)
- # nyc (1)
- # off-topic (9)
- # onyx (15)
- # portkey (12)
- # precept (2)
- # re-frame (15)
- # reagent (10)
- # rum (7)
- # schema (2)
- # shadow-cljs (48)
- # tools-deps (35)
- # yada (1)
Is there a way to make cider pick up my project that isn't a boot/lein project? I am using shadow-cljs and every time I connect to nREPL
getting
wrong-type-argument stringp package-desc
this morning when requiring cider
this morning
more precisely
Debugger entered--Lisp error: (wrong-type-argument stringp package-desc)
signal(wrong-type-argument (stringp package-desc))
epl-package-from-lisp-file("/Users/acrotti/.emacs.d/elpa/clj-refactor-20180420.223/clj-refactor.el")
epl-package-from-file("/Users/acrotti/.emacs.d/elpa/clj-refactor-20180420.223/clj-refactor.el")
(epl-package-version (epl-package-from-file source))
(let* ((source (pkg-info-library-source library)) (version (epl-package-version (epl-package-from-file source)))) (pkg-info--show-version-and-return version show))
pkg-info-library-version(clj-refactor)
(or orig-version (pkg-info-library-version library))
(let* ((package (or package (if (stringp library) (intern library) library))) (orig-version (condition-case nil (pkg-info-library-original-version library) (error nil))) (lib-version (or orig-version (pkg-info-library-version library))) (pkg-version (condition-case nil (pkg-info-package-version package) (error nil))) (version (if (and pkg-version (not (version-list-= lib-version pkg-version))) (format "%s (package: %s)" (pkg-info-format-version lib-version) (pkg-info-format-version pkg-version)) (pkg-info-format-version lib-version)))) (pkg-info--show-version-and-return version show))
pkg-info-version-info(clj-refactor)
cljr--version(t)
cljr--inject-jack-in-dependencies()
(lambda nil (cljr--inject-jack-in-dependencies))()
eval-after-load-helper("/Users/acrotti/.emacs.d/elpa/cider-20180520.2317/cider.elc")
run-hook-with-args(eval-after-load-helper "/Users/acrotti/.emacs.d/elpa/cider-20180520.2317/cider.elc")
do-after-load-evaluation("/Users/acrotti/.emacs.d/elpa/cider-20180520.2317/cider.elc")
require(cider)
eval((require 'cider) nil)
elisp--eval-last-sexp(nil)
eval-last-sexp(nil)
funcall-interactively(eval-last-sexp nil)
call-interactively(eval-last-sexp nil nil)
command-execute(eval-last-sexp)
@andrea.crotti That’s not from CIDER, it’s from clj-refactor.el
.
Seems something’s wrong with the package metadata, I’ve seen others report this as well.
@theeternalpulse CIDER has native support for shadow projects. On jack-in you should get some prompt asking you whether to use lein
or shadow
.
ah, maybe i haven't updated cider in a while
@theeternalpulse This was added in 0.17.
hmm, what about cider-connect-clojurescript, that's what I'm using
since the nrepl server is already created by shadowcljs
that one tells me to choose the project directory
If you want to associate a project with a connection there’s a command named cider-assoc-project-with-connection
.
This could be an old elc file lurking in your .emacs.d @andrea.crotti
I think I deleted the whole elpa
directory alraedy
but I'll do it again
I’m planning to just move the default deps to their defvars and simplify this code. To me it makes no sense.
Ah ok. I think we agreed with @malabarba to do this
I definitely don’t think the deps are risky local variables (if you know what you’re doing).
well I'm actually trying to move to emacs 26 as well in the meanwhile
but I think now it all works fine
Good to hear @andrea.crotti
but actually the bigger problem is that the cider linking to the Clojurescript repl is now not working
I think since I upgraded this morning
even though the cljs repl itself works perfectly fine and I used jack-in-clojurescript
to create it
Suppose reason is @bozhidar that we actually inserting stuff which potentially modifies your REPLs behaviour or could do other funky stuff
> Suppose reason is @bozhidar that we actually inserting stuff which potentially modifies your REPLs behaviour or could do other funky stuff
I’ll take a look at the PR, but if that’s the reasoning I’m going forward with my changes. 🙂
> but actually the bigger problem is that the cider linking to the Clojurescript repl is now not working
@andrea.crotti Can you elaborate on this?
Since this morning if I try to evaluate some code directly in a clojurescript buffer it complains there is no repl @bozhidar
Even if the repl is there and working
Interesting. I don’t have time to test this, but I’ll try to take a look later today. I wonder if it’s not something related to the injection of piggieback I added in the morning.
@benedek I don’t see comments regarding this in https://github.com/clojure-emacs/cider/pull/1552/files
@bozhidar in this project we have already piggieback and in project.clj
35: [com.cemerick/piggieback "0.2.2"]
86: :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}
if that helps
the figwheel auto reloading also works so it's really just evaluating in the buffer
java.lang.IllegalStateException: Can't change/establish root binding of: *cljs-compiler-env* with set
at clojure.lang.Var.set(Var.java:223)
at cemerick.piggieback$run_cljs_repl$fn__15669.doInvoke(piggieback.clj:184)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at cljs.repl$repl_STAR_$read_eval_print__15052.invoke(repl.cljc:881)
and looks suspicious because it has cemerick piggieback in it. not sure why this used to work though
Exception Failed to launch Figwheel CLJS REPL: nREPL connection found but unable to load piggieback.
This is commonly caused by
A) not providing piggieback as a dependency and/or
B) not adding piggieback middleware into your nrepl middleware chain.
example profile.clj code:
-----
:profiles {:dev {:dependencies [[com.cemerick/piggieback <current-version>]
[org.clojure/tools.nrepl <current-version>]]
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}}
-----
Please see the documentation for piggieback here
Note: Cider will inject this config into your project.clj.
This can cause confusion when your are not using Cider. figwheel-sidecar.repl/eval38415/fn--38416 (repl.clj:167)
also the error looks like it still talks about the cemerick version not the cider/piggieback versionupdating to latest fighweel 0.5.16 and now it doesn't throw on startup but it doesn't connect to the repl
Figwheel: Starting nREPL server on port: 7888
WARNING: unable to load "cemerick.piggieback/wrap-cljs-repl" middleware
see here for a working project.clj: https://github.com/manuel-uberti/boodle/blob/master/project.clj
ok. so fighwheel is aware of the two piggiebacks except for one spot with setting the middleware for the repl and it will inject an expectation of cemerick's version unless you specify :nrepl-middleware
@andrea.crotti Yeah, that’s the problem - having the old piggieback there as well.
And, of course, another problem would be trying to use the new piggieback with something that doesn’t support it (e.g. an old version of figwheel).
as far as i can tell current versions are [cider/piggieback "0.3.5"] and lein-figwheel "0.5.16"
figwheel needs to update to not require you to set :nrepl-middleware
(defn start-nrepl-server
[figwheel-options autobuild-options]
(when (:nrepl-port figwheel-options)
(let [middleware (or
(:nrepl-middleware figwheel-options)
["cemerick.piggieback/wrap-cljs-repl"])
resolve-mw (fn [name]
(let [s (symbol name)
ns (symbol (namespace s))]
(if (and
(utils/require? ns)
(resolve s))
(let [var (resolve s)
val (deref var)]
(if (vector? val)
(map resolve val)
(list var)))
(println (format "WARNING: unable to load \"%s\" middleware" name)))))
middleware (mapcat resolve-mw middleware)]
(nrepl-serv/start-server
:port (:nrepl-port figwheel-options)
:bind (:nrepl-host figwheel-options)
:handler (apply nrepl-serv/default-handler middleware)))))
@dpsutton Sorry, I didn’t pay enough attention. Yeah, I guess @bhauman should update this.
so there's lots of places that you check for cider/ or cemerick/ ... I'm wondering if we could remember which is found and then require found/wrap-cljs-repl at that point
not a big deal. you do a good job of making lots of places aware of the two piggiebacks and that's just one place that assumes one
What’s figwheel-main? I thought it was just some way to run figwheel with tools-cli
.
i guess we are using it.
:figwheel
{:nrepl-port 7888
:server-port 3000
:load-all-builds false
:repl true
:ring-handler breeze.jib.server.ring-handler/static-ring-handler
:nrepl-middleware ["cider.piggieback/wrap-cljs-repl"]
}
do you know how i could start diagnosing why the repl just sits at Prompt will show when Figwheel connects to your application
and doesn't see the browser? that seems to be where i am now
if folks aren't using that, you can comment out that line :nrepl-port
and keep working for now
ah. well i was getting the error message that cemerick/wrap-cljs-repl wasn't found so somehow we are using that codepath
> figwheel-main is a complete rewrite of figwheel Oh! I guess I should read a bit about it. The name didn’t imply anything so significant.
the behavior is that i jack in clojurescript, get
Successfully compiled build :raw to "target/raw/jib_out/js/jib.js" in 4.907 seconds.
Launching ClojureScript REPL for build: raw
and then my repl gets stuck at this:
> Prompt will show when Figwheel connects to your applicationand changing the nrepl-middleware to point to cider.piggieback and switching
- [com.cemerick/piggieback "0.2.2"] ; needed by figwheel nrepl
+ [cider/piggieback "0.3.5"] ; needed by figwheel nrepl
so kind of a lot, but when i hadn't changed anything i got the warning that you can't call set! on Can't change/establish root binding of: *cljs-compiler-env* with set
do you mean cider-nrepl? that has been auto injected for a while. recently now it autoinjects cider.piggieback as well
but i have an explicit dependency on cider/piggieback (as of this morning) since i work with some cursive users who won't get the auto
[cider/piggieback "0.3.5"] ; needed by figwheel nrepl
is in my dependencies. it used to be the explicit cemerick 0.2.2 which worked on friday
i have to do that otherwise it will default to cemerick (which was the tangential bug i mentioned earlier)
you should really remove the :nrepl-port
and :nrepl-middleware
keys unless someone is using the cider-connect
workflow
i'm not sure what a cursive workflow is. but most everyone else is on that. which runs lein figwheel raw
and then conencts to that
am getting this though: > [WARNING] No nREPL middleware descriptor in metadata of cider.piggieback/wrap-cljs-repl, see clojure.tools.middleware/set-descriptor!
Hmmm, I think I get what’s going on. The jack-in logic is quite convoluted for different tools - for lein the middleware is probably injected by the cider lein plugin or whatever.
I’m busy right now, so I can’t check, but oh - I hate those differences between the tools so much…
We’ve got some lein plugins at play there, something different for boot and clojure-cli, nothing for gradle.
Yeah, it seems the damn lein code is not using the middlewares config option at all. 😄
I didn’t write this originally myself, so I keep getting surprised by how inconsistent everything there is.
On lein the magic current happens like this https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider_nrepl/plugin.clj
I guess I can check if there’s a clojurescript dependency and put something else here or make this generate the whole thing.
i can't get lein figwheel raw
to work with the setup with cider.piggieback and figwheel 0.5.16. i moved my version of cider back to before any changes to the cljs jack in (to the eldoc fix) and back to cemerick/piggieback and figwheel 0.5.14 i'm back in business
@@ -50,12 +50,12 @@
]]
;; Take ring-core's newer ring-codec dep
- [stasis "2.3.0" :exclusions [ring/ring-codec]]
+ [stasis "2.3.0" :exclusions [ring/ring-codec com.cemerick/piggieback]]
[hiccup "1.0.5"]
;; Jib dev server dependencies
;; These are not needed in production.
- [com.cemerick/piggieback "0.2.2"] ; needed by figwheel nrepl
+ [cider/piggieback "0.3.5"] ; needed by figwheel nrepl
[com.cognitect/transit-clj "0.8.300"] ; used by cljs analysis cache if present
[clojure-watch "0.1.13"]
[http-kit "2.2.0"]
@@ -64,7 +64,7 @@
:plugins [[org.clojure/clojure "1.9.0"]
[lein-cljsbuild "1.1.6" :exclusions [org.clojure/clojure]]
- [lein-figwheel "0.5.14" :exclusions [org.clojure/core.cache]]
+ [lein-figwheel "0.5.16" :exclusions [org.clojure/core.cache]]
[circle/s3-wagon-private "1.2.2" :exclusions [commons-codec]]
[slothcfg "1.0.1"]
[lein-pdo "0.1.1"]]
@@ -173,7 +173,7 @@
{:jvm-opts
^:replace ["-Xmx750m" "-XX:+UseG1GC" "-XX:+UseStringDeduplication"]
- :dependencies [[figwheel-sidecar "0.5.14"
+ :dependencies [[figwheel-sidecar "0.5.16"
:exclusions [org.clojure/clojure cljsjs/react]]
;; nrepl dep is to make sidecar happy and override a default
;; 0.2.12 dep from lein's base profile
@@ -187,7 +187,7 @@
:load-all-builds false
:repl false
:ring-handler breeze.jib.server.ring-handler/static-ring-handler
- :nrepl-middleware ["cemerick.piggieback/wrap-cljs-repl"]}
+ :nrepl-middleware ["cider.piggieback/wrap-cljs-repl"]}
with the "before" changes I can jack in clojurescript and i can run lein figwheel raw
. with the after changes neither is true as they both hang at Prompt will show when Figwheel connects to your applicationI'm pretty sure you need this at the top level :repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}
@bozhidar I just did cljs-jack-in-clojurescript
with the latest and the injection worked without a hitch