Fork me on GitHub
#shadow-cljs
<
2022-11-18
>
Apple05:11:45

2.20.12 is not working here. going back to 2.20.10 openjdk version "19.0.1" 2022-10-18

Apple05:11:58

Exception in thread "main" Syntax error macroexpanding at (closure.clj:77:5).
	at clojure.lang.Compiler$StaticMethodExpr.eval(Compiler.java:1750)
	at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3713)
	at clojure.lang.Compiler$DefExpr.eval(Compiler.java:457)
	at clojure.lang.Compiler.eval(Compiler.java:7199)
	at clojure.lang.Compiler.load(Compiler.java:7653)
	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__6908.invoke(core.clj:6161)
	at clojure.core$load.invokeStatic(core.clj:6160)
	at clojure.core$load.doInvoke(core.clj:6144)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.core$load_one.invokeStatic(core.clj:5933)
	at clojure.core$load_one.invoke(core.clj:5928)
	at clojure.core$load_lib$fn__6850.invoke(core.clj:5975)
	at clojure.core$load_lib.invokeStatic(core.clj:5974)
	at clojure.core$load_lib.doInvoke(core.clj:5953)
	at clojure.lang.RestFn.applyTo(RestFn.java:142)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$load_libs.invokeStatic(core.clj:6016)
	at clojure.core$load_libs.doInvoke(core.clj:6000)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$require.invokeStatic(core.clj:6038)
	at clojure.core$require.doInvoke(core.clj:6038)
	at clojure.lang.RestFn.invoke(RestFn.java:551)
	at shadow.build.js_support$eval18536$loading__6789__auto____18537.invoke(js_support.clj:1)
	at shadow.build.js_support$eval18536.invokeStatic(js_support.clj:1)
	at shadow.build.js_support$eval18536.invoke(js_support.clj:1)
	at clojure.lang.Compiler.eval(Compiler.java:7194)
	at clojure.lang.Compiler.eval(Compiler.java:7183)
	at clojure.lang.Compiler.load(Compiler.java:7653)
	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__6908.invoke(core.clj:6161)
	at clojure.core$load.invokeStatic(core.clj:6160)
	at clojure.core$load.doInvoke(core.clj:6144)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.core$load_one.invokeStatic(core.clj:5933)
	at clojure.core$load_one.invoke(core.clj:5928)
	at clojure.core$load_lib$fn__6850.invoke(core.clj:5975)
	at clojure.core$load_lib.invokeStatic(core.clj:5974)
	at clojure.core$load_lib.doInvoke(core.clj:5953)
	at clojure.lang.RestFn.applyTo(RestFn.java:142)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$load_libs.invokeStatic(core.clj:6016)
	at clojure.core$load_libs.doInvoke(core.clj:6000)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$require.invokeStatic(core.clj:6038)
	at clojure.core$require.doInvoke(core.clj:6038)
	at clojure.lang.RestFn.invoke(RestFn.java:619)
	at shadow.build.resolve$eval16456$loading__6789__auto____16457.invoke(resolve.clj:1)
	at shadow.build.resolve$eval16456.invokeStatic(resolve.clj:1)
	at shadow.build.resolve$eval16456.invoke(resolve.clj:1)
	at clojure.lang.Compiler.eval(Compiler.java:7194)
	at clojure.lang.Compiler.eval(Compiler.java:7183)
	at clojure.lang.Compiler.load(Compiler.java:7653)
	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__6908.invoke(core.clj:6161)
	at clojure.core$load.invokeStatic(core.clj:6160)
	at clojure.core$load.doInvoke(core.clj:6144)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.core$load_one.invokeStatic(core.clj:5933)
	at clojure.core$load_one.invoke(core.clj:5928)
	at clojure.core$load_lib$fn__6850.invoke(core.clj:5975)
	at clojure.core$load_lib.invokeStatic(core.clj:5974)
	at clojure.core$load_lib.doInvoke(core.clj:5953)
	at clojure.lang.RestFn.applyTo(RestFn.java:142)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$load_libs.invokeStatic(core.clj:6016)
	at clojure.core$load_libs.doInvoke(core.clj:6000)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$require.invokeStatic(core.clj:6038)
	at clojure.core$require.doInvoke(core.clj:6038)
	at clojure.lang.RestFn.invoke(RestFn.java:2793)
	at shadow.build.api$eval16448$loading__6789__auto____16449.invoke(api.clj:1)
	at shadow.build.api$eval16448.invokeStatic(api.clj:1)
	at shadow.build.api$eval16448.invoke(api.clj:1)
	at clojure.lang.Compiler.eval(Compiler.java:7194)
	at clojure.lang.Compiler.eval(Compiler.java:7183)
	at clojure.lang.Compiler.load(Compiler.java:7653)
	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__6908.invoke(core.clj:6161)
	at clojure.core$load.invokeStatic(core.clj:6160)
	at clojure.core$load.doInvoke(core.clj:6144)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.core$load_one.invokeStatic(core.clj:5933)
	at clojure.core$load_one.invoke(core.clj:5928)
	at clojure.core$load_lib$fn__6850.invoke(core.clj:5975)
	at clojure.core$load_lib.invokeStatic(core.clj:5974)
	at clojure.core$load_lib.doInvoke(core.clj:5953)
	at clojure.lang.RestFn.applyTo(RestFn.java:142)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$load_libs.invokeStatic(core.clj:6016)
	at clojure.core$load_libs.doInvoke(core.clj:6000)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$require.invokeStatic(core.clj:6038)
	at clojure.core$require.doInvoke(core.clj:6038)
	at clojure.lang.RestFn.invoke(RestFn.java:3659)
	at shadow.build$eval16080$loading__6789__auto____16081.invoke(build.clj:1)
	at shadow.build$eval16080.invokeStatic(build.clj:1)
	at shadow.build$eval16080.invoke(build.clj:1)
	at clojure.lang.Compiler.eval(Compiler.java:7194)
	at clojure.lang.Compiler.eval(Compiler.java:7183)
	at clojure.lang.Compiler.load(Compiler.java:7653)
	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__6908.invoke(core.clj:6161)
	at clojure.core$load.invokeStatic(core.clj:6160)
	at clojure.core$load.doInvoke(core.clj:6144)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.core$load_one.invokeStatic(core.clj:5933)
	at clojure.core$load_one.invoke(core.clj:5928)
	at clojure.core$load_lib$fn__6850.invoke(core.clj:5975)
	at clojure.core$load_lib.invokeStatic(core.clj:5974)
	at clojure.core$load_lib.doInvoke(core.clj:5953)
	at clojure.lang.RestFn.applyTo(RestFn.java:142)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$load_libs.invokeStatic(core.clj:6016)
	at clojure.core$load_libs.doInvoke(core.clj:6000)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$require.invokeStatic(core.clj:6038)
	at clojure.core$require.doInvoke(core.clj:6038)
	at clojure.lang.RestFn.invoke(RestFn.java:3204)
	at shadow.cljs.devtools.api$eval7525$loading__6789__auto____7526.invoke(api.clj:1)
	at shadow.cljs.devtools.api$eval7525.invokeStatic(api.clj:1)
	at shadow.cljs.devtools.api$eval7525.invoke(api.clj:1)
	at clojure.lang.Compiler.eval(Compiler.java:7194)
	at clojure.lang.Compiler.eval(Compiler.java:7183)
	at clojure.lang.Compiler.load(Compiler.java:7653)
	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__6908.invoke(core.clj:6161)
	at clojure.core$load.invokeStatic(core.clj:6160)
	at clojure.core$load.doInvoke(core.clj:6144)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.core$load_one.invokeStatic(core.clj:5933)
	at clojure.core$load_one.invoke(core.clj:5928)
	at clojure.core$load_lib$fn__6850.invoke(core.clj:5975)
	at clojure.core$load_lib.invokeStatic(core.clj:5974)
	at clojure.core$load_lib.doInvoke(core.clj:5953)
	at clojure.lang.RestFn.applyTo(RestFn.java:142)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$load_libs.invokeStatic(core.clj:6016)
	at clojure.core$load_libs.doInvoke(core.clj:6000)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$require.invokeStatic(core.clj:6038)
	at clojure.core$require.doInvoke(core.clj:6038)
	at clojure.lang.RestFn.invoke(RestFn.java:1289)
	at user$eval140$loading__6789__auto____141.invoke(user.clj:1)
	at user$eval140.invokeStatic(user.clj:1)
	at user$eval140.invoke(user.clj:1)
	at clojure.lang.Compiler.eval(Compiler.java:7194)
	at clojure.lang.Compiler.eval(Compiler.java:7183)
	at clojure.lang.Compiler.load(Compiler.java:7653)
	at clojure.lang.RT.loadResourceScript(RT.java:381)
	at clojure.lang.RT.loadResourceScript(RT.java:368)
	at clojure.lang.RT.maybeLoadResourceScript(RT.java:364)
	at clojure.lang.RT.doInit(RT.java:486)
	at clojure.lang.RT.init(RT.java:467)
	at clojure.main.main(main.java:38)
Caused by: java.lang.NoClassDefFoundError: com/google/common/collect/Streams
	at com.google.javascript.jscomp.deps.ModuleLoader.createRootPaths(ModuleLoader.java:259)
	at com.google.javascript.jscomp.deps.ModuleLoader.<init>(ModuleLoader.java:154)
	at com.google.javascript.jscomp.deps.ModuleLoader$Builder.build(ModuleLoader.java:146)
	at com.google.javascript.jscomp.deps.ModuleLoader.<clinit>(ModuleLoader.java:414)
	at com.google.javascript.jscomp.DiagnosticGroups.<clinit>(DiagnosticGroups.java:178)
	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
	at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160)
	at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.ensureClassInitialized(MethodHandleAccessorFactory.java:300)
	at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.newMethodAccessor(MethodHandleAccessorFactory.java:71)
	at java.base/jdk.internal.reflect.ReflectionFactory.newMethodAccessor(ReflectionFactory.java:159)
	at java.base/java.lang.reflect.Method.acquireMethodAccessor(Method.java:720)
	at java.base/java.lang.reflect.Method.invoke(Method.java:575)
	at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:167)
	at clojure.lang.Compiler$StaticMethodExpr.eval(Compiler.java:1743)
	... 178 more
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.Streams
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 192 more

thheller05:11:31

check your dependencies? looks like guava is missing? maybe you excluded it manually?

Apple06:11:01

diff of clj -Stree

thheller06:11:38

so it is manually excluded?

thheller06:11:16

why is there an X and :superseded, shadow-cljs is not doing this. so it must be your deps.edn file

thheller06:11:21

maybe that was to work arround earlier problems where the closure compiler didn't declare dependencies properly?

thheller06:11:05

it now does

Apple06:11:20

i have com.lambdaisland/classpath 0.4.44, which depends on

. com.google.guava/guava 31.1-android :newer-version
`

Apple06:11:40

no exclusion that i can see except

luminus-transit/luminus-transit    {:mvn/version "0.1.5" :exclusions [com.cognitect/transit-clj]}

thheller06:11:12

maybe that version is incompatible with the closure compiler. no clue what the -android qualifier does

Apple06:11:41

no problem.

Apple06:11:17

does this css reload config look alright?

Apple06:11:22

:devtools   {:after-load kit.net.core/mount-root
                     :devtools {:watch-dir "resources/public"
                                :watch-path "/"}}

thheller06:11:59

devtools nested in devtools?

thheller06:11:34

:devtools {:after-load kit.net.core/mount-root
           :watch-dir "resources/public"}

thheller06:11:36

should be fine

Apple06:11:56

im so sorry.... what an idiot

Abhinav08:11:03

Hey, is it possible to add :injections in ~/.shadow-cljs/config.edn like we can do in ~/lein/profiles.clj?

thheller08:11:21

to do what? :injections is a leiningen thing, so it is not supported no. you can of course just use leiningen, and use all the features it has

Abhinav08:11:57

with :injections i can require a namespace in leiningen. I wanted to replicate that in shadow-cljs.

thheller08:11:30

what does requiring a namespace do to leiningen? and what would it do for shadow-cljs?

thheller08:11:07

I have no clue what :injections even does, so please explain. I only know that it exists

Abhinav08:11:17

I may be abusing injections, but requiring a namespace in the injections will require it inside the namespace defined in :init-ns 😅

thheller08:11:42

why not just require it in :init-ns?

thheller08:11:05

is this for a CLJS build or for the CLJ parts?

thheller08:11:20

I'm still nowhere near understanding what it is your are trying to do

Abhinav08:11:37

okay, I’ll try to explain. sorry. I have a repl-based tool -https://github.com/AbhinavOmprakash/snitch that I add to profiles.clj and config.edn files. In my library I intern the macros to clojure.core so the macros are available in all namespaces in whichever project I’m in.

#?(:clj (do (intern 'clojure.core (with-meta 'defn* (meta #'defn*)) #'defn*)
            (intern 'clojure.core (with-meta '*fn (meta #'*fn)) #'*fn)
            (intern 'clojure.core (with-meta 'defmethod* (meta #'defmethod*)) #'defmethod*)
            (intern 'clojure.core (with-meta '*let (meta #'*let)) #'*let)
            (try
              (intern 'cljs.core (with-meta 'defn* (meta #'defn*)) #'defn*)
              (intern 'cljs.core (with-meta '*fn (meta #'*fn)) #'*fn)
              (intern 'cljs.core (with-meta 'defmethod* (meta #'defmethod*)) #'defmethod*)
              (intern 'cljs.core (with-meta '*let (meta #'*let)) #'*let)
              (catch Exception _))))
if I require it in the :injections of profiles.clj the macros get interned when lein starts up. I wanted to do something similar with shadow-cljs.

thheller08:11:51

why use injections at all? wouldn't a user.clj work as well? that gets loaded unconditionally in CLJ on startup?

Abhinav08:11:08

hmm. I’m not familiar with that setup 😅 how would I support it in cljs?

thheller08:11:23

this is purely macro side from what I can tell?

thheller08:11:34

so you create a user.clj as a classpath root

thheller08:11:47

if you use the default setup that would be src/dev/user.clj

thheller08:11:57

in it (ns user ...) with whatever require you want

thheller08:11:06

that namespace is loaded when shadow-cljs starts

thheller08:11:08

or anything else

thheller08:11:20

it is ALWAYS loaded, unconditionally

thheller08:11:42

but it must be in the project, so it cannot be controlled via ~/.shadow-cljs/config.edn

thheller09:11:02

and no, there is no equiv functionality to do something like that in shadow-cljs

thheller09:11:25

but as I said before you can just use lein. assuming this is all in CLJ anyways there is nothing shadow-cljs needs to do

Abhinav09:11:28

Oh I see. I’ll give this a shot. I think this is what I need. Thanks so much for your help