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?
send snippets of what you can from deps.edn & shadow-cljs.edn
{: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 depsthat’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}}}}
move your :source-paths and :dependencies from shadow-cljs.edn, to deps.edn
source-paths is same in deps?
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
yeah src is already configured in deps.edn. so just remove that whole :source-paths from shadow-cljs.edn
I can make shadow-cljs use deps?
yes
:deps true
{: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}}}}}like that
ah so I need to add deps true, then I would like to contain my cljs stuff in an alias in deps
nice, thanks
yeah you can use an alias in deps.edn for cljs if you want
I see, then I enable cljs alias in deps pane in IDE
yeah like that
ok thanks
mine isn’t enabled there but you would enable it
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"}}
`in your alias if you’re using that
yeah probably best
try and match shadow-cljs version with your cli
let me know how you go. It should be pretty quick to get going
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
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
The pom.xml is just for cursive to figure out deps and stuff. You wouldn’t commit it or use it for anything else
But i still would highly recommend :deps true instead.
yeah this seems to work now, thank you
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
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
Broken boot runtime:
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.
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)
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.
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?
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)
there are 1-2 reports from cursive users in addition to mine in this channel