This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-31
Channels
- # announcements (4)
- # aws-lambda (1)
- # babashka (25)
- # beginners (60)
- # calva (33)
- # cider (15)
- # cljdoc (1)
- # clojure (28)
- # clojure-dev (1)
- # clojure-europe (4)
- # clojurescript (29)
- # clojureverse-ops (4)
- # conjure (10)
- # datomic (4)
- # graalvm (4)
- # holy-lambda (4)
- # honeysql (13)
- # introduce-yourself (1)
- # lambdaisland (1)
- # missionary (11)
- # music (2)
- # off-topic (35)
- # pathom (17)
- # pedestal (20)
- # reagent (3)
- # sci (10)
- # shadow-cljs (39)
- # sql (6)
- # tools-deps (6)
- # vim (1)
--- SHADOW-CLJS FAILED TO LOAD! ----------------------
This is most commonly caused by a dependency conflict.
When using deps.edn or project.clj you must ensure that all
required dependencies are provided with the correct version.
You are using shadow-cljs version: 2.11.8
The important dependencies are:
org.clojure/clojure "1.10.1"
org.clojure/clojurescript "1.10.773"
com.google.javascript/closure-compiler-unshaded "v20200830"
I'm getting this but only on a particular machine. Have tried different versions of shadow, deleting caches, not specifying clojurescript as a dependency, closure-compiler-unshaded
in exclusions, not specifying clojure or clojurescript. Even including closure-compiler-unshaded
in deps.edn
. Is that a wrong version of closure-compiler-unshaded
that is somehow being picked up? Any way to really start from scratch, as there's nothing actually wrong with this particular deps.edn
/Fulcro project.
and what is the rest of the error you get? I mean why does it fail to load? it should have a nice long stacktrace?
Yes sure. This is it (I stripped some lines as it was too big for slack):
The error encountered was:
Syntax error macroexpanding at (closure.clj:70:5).
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:459)
at clojure.lang.RT.load(RT.java:424)
at clojure.core$load$fn__6839.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:619)
at shadow.build.js_support$eval12458$loading__6721__auto____12459.invoke(js_support.clj:1)
at shadow.build.js_support$eval12458.invokeStatic(js_support.clj:1)
at shadow.build.js_support$eval12458.invoke(js_support.clj:1)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:459)
at clojure.lang.RT.load(RT.java:424)
at clojure.core$load$fn__6839.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:703)
at shadow.build.resolve$eval10708$loading__6721__auto____10709.invoke(resolve.clj:1)
at shadow.build.resolve$eval10708.invokeStatic(resolve.clj:1)
at shadow.build.resolve$eval10708.invoke(resolve.clj:1)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:459)
at clojure.lang.RT.load(RT.java:424)
at clojure.core$load$fn__6839.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:2793)
at shadow.build.api$eval10700$loading__6721__auto____10701.invoke(api.clj:1)
at shadow.build.api$eval10700.invokeStatic(api.clj:1)
at shadow.build.api$eval10700.invoke(api.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:7177)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.load(Compiler.java:7636)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:459)
at clojure.lang.RT.load(RT.java:424)
at clojure.core$load$fn__6839.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:3204)
at shadow.build$eval10694$loading__6721__auto____10695.invoke(build.clj:1)
at shadow.build$eval10694.invokeStatic(build.clj:1)
at shadow.build$eval10694.invoke(build.clj:1)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:459)
at clojure.lang.RT.load(RT.java:424)
at clojure.core$load$fn__6839.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:3204)
at shadow.cljs.devtools.api$eval2236$loading__6721__auto____2237.invoke(api.clj:1)
at shadow.cljs.devtools.api$eval2236.invokeStatic(api.clj:1)
at shadow.cljs.devtools.api$eval2236.invoke(api.clj:1)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:459)
at clojure.lang.RT.load(RT.java:424)
at clojure.core$load$fn__6839.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:1289)
at shadow.cljs.devtools.cli_actual$eval173$loading__6721__auto____174.invoke(cli_actual.clj:1)
at shadow.cljs.devtools.cli_actual$eval173.invokeStatic(cli_actual.clj:1)
at shadow.cljs.devtools.cli_actual$eval173.invoke(cli_actual.clj:1)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:459)
at clojure.lang.RT.load(RT.java:424)
at clojure.core$load$fn__6839.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:665)
at clojure.core$serialized_require.invokeStatic(core.clj:6079)
at clojure.core$requiring_resolve.invokeStatic(core.clj:6088)
at clojure.core$requiring_resolve.invoke(core.clj:6082)
at shadow.cljs.devtools.cli$_main$fn__166.invoke(cli.clj:70)
at shadow.cljs.devtools.cli$_main.invokeStatic(cli.clj:69)
at shadow.cljs.devtools.cli$_main.doInvoke(cli.clj:67)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.core$apply.invokeStatic(core.clj:665)
at clojure.main$main_opt.invokeStatic(main.clj:514)
at clojure.main$main_opt.invoke(main.clj:510)
at clojure.main$main.invokeStatic(main.clj:664)
at clojure.main$main.doInvoke(main.clj:616)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:40)
Caused by: java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V
at com.google.javascript.rhino.IR.name(IR.java:407)
at com.google.javascript.jscomp.VarCheck.<clinit>(VarCheck.java:97)
at com.google.javascript.jscomp.DiagnosticGroups.<clinit>(DiagnosticGroups.java:243)
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:167)
at clojure.lang.Compiler$StaticMethodExpr.eval(Compiler.java:1733)
ok thats a conflict on the guava
dependency. frequently happens with datomic on the classpath
ideally move all your CLJ dependencies into a separate alias so its not active when compiling CLJS
no clue if things actually work with exclusions since both datomic and closure-compiler actually need and use guava. don't know if they like each others versions.
Right thanks. I know I've excluded com.google.guava/guava from Datomic for other projects and it didn't seem to harm Datomic. But tried here and it didn't help. I just get this error when yarn shadow-cljs server
. At least we have a solution.
Still hard to explain why this deps.edn project works fine elsewhere, including on one of my other computers.
To try and fix the problem I edited deps.edn
moving the com.datomic/datomic-pro
map-entry from :deps
to all the aliases that need datomic. So datomic should not be on the classpath that shadow-cljs.edn uses, as shadow-cljs.edn has :deps true
, and thus doesn't use any of the aliases, just the default :deps
. Did not help unfortunately 😞
it might not be datomic. guava is a pretty common dependency. check with clj -Stree
or so what your dependencies look like
Yes there was more: google-apps-clj
was the remaining culprit. So problem fixed. Now I've got the much more minor problem of dependencies duplicated in 5 aliases. I'm not sure there's a way to tidy this up (merge maps) in deps.edn
. But overall 😄.
I always recommend just keeping you CLJS dependencies separate in shadow-cljs.edn
. works perfectly fine unless you need git deps
Got it yeah. Also in your docs you mention going for :deps {:aliases [:cljs]}
. That could be another alternative better setup than what I've got now. I'll try not using deps.edn
at all first though.
if you go with the alias you still need to move all your CLJ stuff out of the base and into its own alias
Using shadow-cljs.edn
:dependencies
a good solution. I've removed cljs-only libs from deps.edn
and the few that now exist in both config files are both clj and cljs anyway. So overall the whole thing makes sense. Works for development but I may have broken things for production - maybe an uberjar is created only from deps.edn
artifacts and thus now won't include cljs-only libs.
There's something askew in my understanding then. If an uberjar is the only source of all code for the application then surely it must either include the compiled javascript or the cljs-only libs that can create the compiled javascript. Under :builds
of the shadow-cljs.edn
there is a :prod
key. So I suppose it is used as part of creating the uberjar. So the uberjar will contain compiled javascript and no need for any cljs-only libs in the deps.edn
.
yes, uberjar should only contain the release
version of a build. if you have a :prod
build you are likely using shadow-cljs wrong since you should have the same build for development watch
and production release
but no cljs-libs will be required in your CLJ runtime so they shouldn't be in the uberjar (all they do is increase the size so its not super critical though)
Hi. What does npx shadow-cljs run do?
npx shadow-cljs help run
gives no helpful informationI am seeing this error
> (def a 3)
Execution error (TypeError) at (<cljs repl>:1).
undefined is not an object (evaluating 'cljs.user.a = (3)')
nil
cljs.user=>
What could be the potential cause?@i impossible to comment without more context. what did you run? which runtime is this?
Couldn’t make a minimal example for my own code. But I found playing with https://github.com/PEZ/rn-rf-shadow also has the same issue.