This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-25
Channels
- # announcements (3)
- # asami (63)
- # babashka (5)
- # babashka-sci-dev (32)
- # beginners (56)
- # calva (2)
- # cider (28)
- # clj-commons (9)
- # clj-kondo (16)
- # cljdoc (41)
- # cljs-dev (19)
- # clojure (67)
- # clojure-europe (15)
- # clojure-nl (1)
- # clojure-poland (1)
- # clojure-uk (2)
- # clojurescript (27)
- # community-development (10)
- # data-science (2)
- # datascript (8)
- # datomic (21)
- # events (3)
- # fulcro (54)
- # graalvm (18)
- # introduce-yourself (2)
- # juxt (3)
- # lsp (6)
- # music (1)
- # nextjournal (8)
- # off-topic (44)
- # omni-trace (1)
- # reitit (13)
- # releases (3)
- # rewrite-clj (4)
- # shadow-cljs (10)
- # spacemacs (6)
- # sql (12)
- # tools-build (17)
- # tools-deps (3)
- # web-security (1)
hello! have been trying to make cider-pprint-eval-defun-at-point
work in CLJS repl with shadow, which seems to be implemented on the shadow side for https://github.com/thheller/shadow-cljs/commit/285829fcc9113ad34d5b0d5e99f4e6c78874e2a4, maybe someone got it working? connecting to shadow's nrepl server, running shadow with latest nrepl
, cider-nrepl
, piggieback
deps injected
@UDQ2UEPMY, just tried this in my shadow build and it seems to work. I'm on cider 1.1.0, nrepl 0.8.3, and cider-nrepl 0.26.0. I don't think piggieback is relevant for a shadow-cljs connection since it has its own middleware to make a cljs repl.
thank you! turned out pretty printing just broke on all my inputs because of #js tags and some other stuff, I wasn't smart enough to test it on pure data first 🥲
Hi all, wondering what would be the best way to ensure that I have (set! *print-namespace-maps* nil)
automatically set when I connect an nrepl via cider. Would it be a cider or nrepl configuration point? Thanks!
Does anybody have any helpful info as to why emacs process hangs, eating 100% CPU and me not being able to interact with the terminal, when running cider and nrepl via cider-jack-in? Appears to happen everytime I encounter a ClassCastException
?
clojure-cli command:
/usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0"} refactor-nrepl/refactor-nrepl {:mvn/version "3.2.0"} cider/cider-nrepl {:mvn/version "0.28.1"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:dev:cider/nrepl
This? Or debug info from emacs, I appear not to get the latter, since everything just freezes.
Execution error (ClassCastException) at migratus.database/connect* (database.clj:132).
class com.zaxxer.hikari.HikariDataSource cannot be cast to class java.sql.Connection (com.zaxxer.hikari.HikariDataSource is in unnamed module of loader 'app'; java.sql.Connection is in module java.sql of loader 'platform')
that’s just normal application code it appears. You are trying to run migrations and its not happy
yeah, just a stupid code error, but that's all the info that pops up. will try your suggestion
here's the stacktrace causing emacs to become unresponsive, running clj -M:dev
{:clojure.main/message
"Execution error (NullPointerException) at migratus.database/connect* (database.clj:133).\nCannot invoke \"java.sql.Connection.setAutoCommit(boolean)\" because \"conn\" is null\n",
:clojure.main/triage
{:clojure.error/class java.lang.NullPointerException,
:clojure.error/line 133,
:clojure.error/cause
"Cannot invoke \"java.sql.Connection.setAutoCommit(boolean)\" because \"conn\" is null",
:clojure.error/symbol migratus.database/connect*,
:clojure.error/source "database.clj",
:clojure.error/phase :execution},
:clojure.main/trace
{:via
[{:type clojure.lang.ExceptionInfo,
:message "Error on key :db/datasource when building system",
:data
{:reason :integrant.core/build-threw-exception,
:system {},
:function
#object[clojure.lang.MultiFn 0x54d16074 "[email protected]"],
:key :db/datasource,
:value
{:db-spec
{:dbtype "postgresql",
:password
"pazzword",
:connectionInitSql "COMMIT;",
:username "db_user",
:port 5432,
:dbname "my_database",
:host "192.168.0.1",
:maximumPoolSize 3}}},
:at [integrant.core$build_exception invokeStatic "core.cljc" 285]}
{:type java.lang.NullPointerException,
:message
"Cannot invoke \"java.sql.Connection.setAutoCommit(boolean)\" because \"conn\" is null",
:at
[migratus.database$connect_STAR_
invokeStatic
"database.clj"
133]}],
:trace
[[migratus.database$connect_STAR_ invokeStatic "database.clj" 133]
[migratus.database$connect_STAR_ invoke "database.clj" 117]
[migratus.database.Database init "database.clj" 255]
[migratus.core$init invokeStatic "core.clj" 170]
[migratus.core$init doInvoke "core.clj" 167]
[clojure.lang.RestFn invoke "RestFn.java" 410]
[backend.db.datasource$eval26692$fn__26694
invoke
"datasource.clj"
22]
[clojure.lang.MultiFn invoke "MultiFn.java" 234]
[integrant.core$try_build_action invokeStatic "core.cljc" 294]
[integrant.core$try_build_action invoke "core.cljc" 293]
[integrant.core$build_key invokeStatic "core.cljc" 302]
[integrant.core$build_key invoke "core.cljc" 298]
[clojure.core$partial$fn__5861 invoke "core.clj" 2643]
[clojure.core.protocols$fn__8181 invokeStatic "protocols.clj" 168]
[clojure.core.protocols$fn__8181 invoke "protocols.clj" 124]
[clojure.core.protocols$fn__8136$G__8131__8145
invoke
"protocols.clj"
19]
[clojure.core.protocols$seq_reduce invokeStatic "protocols.clj" 31]
[clojure.core.protocols$fn__8168 invokeStatic "protocols.clj" 75]
[clojure.core.protocols$fn__8168 invoke "protocols.clj" 75]
[clojure.core.protocols$fn__8110$G__8105__8123
invoke
"protocols.clj"
13]
[clojure.core$reduce invokeStatic "core.clj" 6830]
[clojure.core$reduce invoke "core.clj" 6812]
[integrant.core$build invokeStatic "core.cljc" 325]
[integrant.core$build invoke "core.cljc" 305]
[integrant.core$init invokeStatic "core.cljc" 431]
[integrant.core$init invoke "core.cljc" 423]
[integrant.core$init invokeStatic "core.cljc" 428]
[integrant.core$init invoke "core.cljc" 423]
[backend.system$run invokeStatic "system.clj" 31]
[backend.system$run invoke "system.clj" 30]
[backend.core$_main invokeStatic "core.clj" 9]
[backend.core$_main doInvoke "core.clj" 7]
[clojure.lang.RestFn invoke "RestFn.java" 397]
[clojure.lang.AFn applyToHelper "AFn.java" 152]
[clojure.lang.RestFn applyTo "RestFn.java" 132]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.core$apply invokeStatic "core.clj" 667]
[clojure.main$main_opt invokeStatic "main.clj" 514]
[clojure.main$main_opt invoke "main.clj" 510]
[clojure.main$main invokeStatic "main.clj" 664]
[clojure.main$main doInvoke "main.clj" 616]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.main main "main.java" 40]],
:cause
"Cannot invoke \"java.sql.Connection.setAutoCommit(boolean)\" because \"conn\" is null"}}
i’m wondering why its trying to do stuff. Do you have any top level stuff in user.clj?
Things i do to diagnose: start removing the refactor stuff as sometimes that can get out of date. If still an error, try in a blank project to ensure that its not related to the particular project
Thanks, will try and remove refactor stuff, thing is, this has happened for a while now, even before I added refactor yesterday.
yeah. my general idea is to remove all tooling, ensure that it fundamentally works. Then slowly reintroduce a single tool at a time.
bah, removing all the extra stuff did not bring emacs to silence. thanks, @dpsutton. Said differently: Problem solved.
But what was the problem?
I am too embarrassed to tell, but here it is: never ever blindly copy some random person's cider config and expect it to work. I should have known, but I was desperately trying to tidy up my emacs config, and forgot to clean up the cider specific one. Shit happens.
what was the offending bit? Knowing the issue can help others in the future. I doubt you’ll be the last person to have this and it could help diagnosing in the future
There’s no embarrassment about using a config and there being a foot-gun. It’d be nice to know the footgun for the future though
Good point.
(use-package cider
:ensure t
:defer t
:init (add-hook 'cider-mode-hook #'clj-refactor-mode)
:diminish subword-mode ;; <-- THIS WAS THE CULPRIT
:config
(setq nrepl-log-messages t
cider-repl-display-in-current-window t
cider-repl-use-clojure-font-lock t
cider-prompt-save-file-on-load 'always-save
cider-font-lock-dynamically '(macro core function var)
nrepl-hide-special-buffers t
cider-overlays-use-font-lock t)
(cider-repl-toggle-pretty-printing) )
Ijust simply didn't have the package installedi would never have thought to look there. So thanks for sharing. And that’s super subtle. Not stupid at all
I've written less than 1% of the shell or emacs config that I use, so I can definitely relate! Very understandable. Kudos for sticking with it and finding the issue!