cursive

roklenarcic 2025-09-14T10:55:15.750729Z

I have a project that has mixed CLJ and CLJS sources. The CLJ part has a deps.edn that works fine, but CLJS part has shadow-cljs.edn with deps. When I open cljs files in the editor all the imports from cljs dependencies have yellow underlines and generally the IDE support doesn’t work in those files because the dependencies are not known. How do I fix this?

caleb.macdonaldblack 2025-09-14T12:30:43.136259Z

send snippets of what you can from deps.edn & shadow-cljs.edn

roklenarcic 2025-09-14T12:31:22.893949Z

{:paths ["src" "resources"]
 :deps {buddy/buddy-core {:mvn/version "1.12.0-430"}
        org.clojure/clojure {:mvn/version "1.12.1"}
        org.clj-commons/hickory {:mvn/version "0.7.7"}
        clj-commons/clj-yaml {:mvn/version "1.0.29"}
        hiccup/hiccup {:mvn/version "2.0.0"}
        com.nextjournal/beholder {:mvn/version "1.0.3"}
        medley/medley {:mvn/version "1.4.0"}
        com.cnuernber/charred {:mvn/version "1.037"}
        metosin/malli {:mvn/version "0.19.1"}

        ;; Unified logging for server
        com.taoensso/timbre {:mvn/version "6.7.1"}
        org.slf4j/slf4j-api {:mvn/version "2.0.17"}
        org.slf4j/log4j-over-slf4j {:mvn/version "2.0.17"} ; auto sends log4j to slf4j
        org.slf4j/jul-to-slf4j {:mvn/version "2.0.17"} ; auto sends java.util.logging to slf4j
        org.slf4j/jcl-over-slf4j {:mvn/version "2.0.17"} ; auto-sends java.common.logging to slf4j
        com.fzakaria/slf4j-timbre {:mvn/version "0.4.1"} ; hooks slf4j to timbre

        }
 :aliases {:dev {:extra-paths ["dev"]
                 :jvm-opts ["-Djdk.attach.allowAttachSelf"]
                 :extra-deps {com.clojure-goes-fast/clj-async-profiler {:mvn/version "1.6.2"}}}
           :test {:extra-paths ["test"]
                  :extra-deps {org.clojure/test.check {:mvn/version "1.1.1"}
                               io.github.cognitect-labs/test-runner
                               {:git/tag "v0.5.0" :git/sha "48c3c67"}}}}}
that’s deps

roklenarcic 2025-09-14T12:31:38.211389Z

that’s shadow:

{:source-paths ["src"]
 :dependencies [[com.pitch/uix.core "1.4.4"]
                [com.pitch/uix.dom "1.4.4"]]
 :dev-http {8000 "target"}
 :builds {:recipe-components {:target :browser
                              :output-dir "target/js"
                              :asset-path "/js"
                              :modules {:recipe-widgets {:entries [roklenarcic.cookery.docs.recipe-widgets]}}
                              :devtools {:http-root "target"
                                         :http-port 8000
                                         :before-load roklenarcic.cookery.docs.recipe-widgets/before-reload
                                         :after-load roklenarcic.cookery.docs.recipe-widgets/after-reload}}}}

caleb.macdonaldblack 2025-09-14T12:32:43.956369Z

move your :source-paths and :dependencies from shadow-cljs.edn, to deps.edn

roklenarcic 2025-09-14T12:33:10.276589Z

source-paths is same in deps?

caleb.macdonaldblack 2025-09-14T12:33:20.206439Z

shadow-cljs can manage deps and paths for you, but since your using deps.edn, then you won’t need shadow-cljs to do this for you

caleb.macdonaldblack 2025-09-14T12:33:47.560209Z

yeah src is already configured in deps.edn. so just remove that whole :source-paths from shadow-cljs.edn

roklenarcic 2025-09-14T12:33:52.786179Z

I can make shadow-cljs use deps?

caleb.macdonaldblack 2025-09-14T12:33:56.408269Z

yes

caleb.macdonaldblack 2025-09-14T12:34:00.105519Z

:deps true

caleb.macdonaldblack 2025-09-14T12:34:16.128679Z

{:deps         true
 :dev-http     {8020 "public"}
 :repl-options {:nrepl-middleware [shadow.cljs.devtools.server.nrepl/middleware]}
 :builds       {:app {:target     :browser
                      :output-dir "public/js"
                      :asset-path "/js"
                      :modules    {:main {:init-fn game.core/init}}}}}

caleb.macdonaldblack 2025-09-14T12:34:17.715829Z

like that

roklenarcic 2025-09-14T12:34:33.321229Z

ah so I need to add deps true, then I would like to contain my cljs stuff in an alias in deps

caleb.macdonaldblack 2025-09-14T12:34:37.275459Z

https://shadow-cljs.github.io/docs/UsersGuide.html#deps-edn

roklenarcic 2025-09-14T12:34:52.550609Z

nice, thanks

caleb.macdonaldblack 2025-09-14T12:34:59.034109Z

yeah you can use an alias in deps.edn for cljs if you want

roklenarcic 2025-09-14T12:35:44.117419Z

I see, then I enable cljs alias in deps pane in IDE

caleb.macdonaldblack 2025-09-14T12:35:56.935359Z

caleb.macdonaldblack 2025-09-14T12:36:03.935639Z

yeah like that

roklenarcic 2025-09-14T12:36:09.037589Z

ok thanks

caleb.macdonaldblack 2025-09-14T12:36:25.542779Z

mine isn’t enabled there but you would enable it

caleb.macdonaldblack 2025-09-14T12:37:54.052119Z

you might also need to add some more deps to “deps.edn”:

{thheller/shadow-cljs      {:mvn/version "3.2.0"}
 org.clojure/clojurescript {:mvn/version "1.12.42"}}
`

caleb.macdonaldblack 2025-09-14T12:38:13.037729Z

in your alias if you’re using that

roklenarcic 2025-09-14T12:38:57.248549Z

yeah probably best

caleb.macdonaldblack 2025-09-14T12:39:19.551749Z

try and match shadow-cljs version with your cli

caleb.macdonaldblack 2025-09-14T12:41:47.623819Z

let me know how you go. It should be pretty quick to get going

caleb.macdonaldblack 2025-09-14T12:44:41.456559Z

I just realised there is another way to do this without using :deps true . You can generate a pom.xml with shadow-cljs cli: npx shadow-cljs pom Then you can import that pom into intellij and keep using your shadow-cljs.edn as is

caleb.macdonaldblack 2025-09-14T12:44:59.359669Z

https://shadow-cljs.github.io/docs/UsersGuide.html#_cursive

roklenarcic 2025-09-14T12:45:47.317679Z

I mean sure… but this is not a front end only project so I cannot make that pom basis for the project as a whole

caleb.macdonaldblack 2025-09-14T12:46:53.328359Z

The pom.xml is just for cursive to figure out deps and stuff. You wouldn’t commit it or use it for anything else

caleb.macdonaldblack 2025-09-14T12:47:28.018879Z

But i still would highly recommend :deps true instead.

roklenarcic 2025-09-14T12:48:34.218039Z

yeah this seems to work now, thank you

🎉 1
Dustin Getz (Hyperfiddle) 2025-09-14T17:47:18.263789Z

I am experiencing a Cursive plugin crash on load after upgrading to IDEA 2025.2 and using a custom Boot runtime for the IDE , disabling Cursive or reverting to the Use Default Runtime repairs the issue and allows Cursive to load

Dustin Getz (Hyperfiddle) 2025-09-14T17:47:23.740089Z

Dustin Getz (Hyperfiddle) 2025-09-14T17:48:54.897909Z

If I am not mistaken, this Boot runtime for the IDE configuration used to work, it is important on Apple SIlicon because the latest Jetbrains jres degrade the IDE UI performance dramatically when using multiple displays

Dustin Getz (Hyperfiddle) 2025-09-14T17:49:00.039239Z

Broken boot runtime:

cfleming 2025-09-14T19:53:06.937889Z

What is the crash you're seeing? Do you have a link to information about the multiple display problem? Generally you'll want to switch to another JetBrains JRE rather than OpenJDK, and I suspect that switching to something other than 21 will not work because code (Cursive and other parts of IntelliJ) is compiled for 21 these days.

Dustin Getz (Hyperfiddle) 2025-09-14T20:22:03.946859Z

Do you know at which version did Cursive start requiring java 21? I have been running java 17 for a while, until I upgraded to IDEA 2025.2 yesterday (and upgraded Cursive alongside)

cfleming 2025-09-14T22:17:24.006639Z

Looks like Cursive 2025.2 - I thought it was earlier than that. I can probably revert to building Java 17 byte code since I don't use any of the recent Java language features. But sooner or later something will require Java 21 since that's been the default in IntelliJ since 2024.2 IIRC. I'm surprised the IntelliJ platform code isn't compiled against 21.

👀 1
cfleming 2025-09-14T22:18:29.697829Z

Do you have any links to e.g. YouTrack issues talking about the monitor issues with newer JBRs? Have you tried running a more recent one than is shipped with the IDE by default?

Dustin Getz (Hyperfiddle) 2025-09-15T00:38:59.601839Z

i will experiment and see if i can get it working without slowdowns on a more recent build. I don't have an apple or jetbrains ticket regarding the apple silicon slowdown - i believe it is connected with M1 chips unifying ram and vram, and running many displays (I run 4 at 1440p)

Dustin Getz (Hyperfiddle) 2025-09-15T00:39:57.486079Z

there are 1-2 reports from cursive users in addition to mine in this channel