Fork me on GitHub
#shadow-cljs
<
2021-05-14
>
caleb.macdonaldblack05:05:53

We’ve tried deleting .shadow-cljs, target and compiled js. We’ve upgraded to shadow-cljs 2.13.0 as well

caleb.macdonaldblack05:05:01

We’ve tried running a new shell as well

caleb.macdonaldblack05:05:12

Any ideas. Thheller expains some incompatibility with version of CLJS and shadow. We’re not specifying CLJS in our deps as afaik, shadow-cljs pull them in with the correct version.

caleb.macdonaldblack05:05:15

I had to update any deps using goog.isBoolean.

pedrorgirardi07:05:20

I started getting this error

Execution error (ClassNotFoundException) at jdk.internal.loader.BuiltinClassLoader/loadClass (BuiltinClassLoader.java:581).
jdk.vm.ci.services.Services
after upgrading from version 2.12.5 to 2.13.0. I start the watch process with npx shadow-cljs watch :main. Is there something that I need to change in shadow-cljs.edn or the way that I'm starting Shadow CLJS in watch mode?

thheller07:05:27

no clue, never seen that error before. did you by any chance change your JVM installation at the same time?

thheller07:05:54

unlikely to be anything in shadow-cljs, more likely something else in your setup

pedrorgirardi07:05:32

Didn't change my JVM. I'm using openjdk version "15.0.1" 2020-10-20 on macOS.

pedrorgirardi07:05:01

But I also tried with openjdk version "11.0.10" 2021-01-19 without luck.

pedrorgirardi07:05:59

It's loooong file, but this might help

pedrorgirardi07:05:05

{:clojure.main/message
 "Execution error (ClassNotFoundException) at jdk.internal.loader.BuiltinClassLoader/loadClass (BuiltinClassLoader.java:606).\njdk.vm.ci.services.Services\n",
 :clojure.main/triage
 {:clojure.error/class java.lang.ClassNotFoundException,
  :clojure.error/line 606,
  :clojure.error/cause "jdk.vm.ci.services.Services",
  :clojure.error/symbol
  jdk.internal.loader.BuiltinClassLoader/loadClass,
  :clojure.error/source "BuiltinClassLoader.java",
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type java.util.ServiceConfigurationError,
    :message
    "org.graalvm.polyglot.impl.AbstractPolyglotImpl: Provider com.oracle.truffle.polyglot.PolyglotImpl could not be instantiated",
    :at [java.util.ServiceLoader fail "ServiceLoader.java" 584]}
   {:type java.lang.NoClassDefFoundError,
    :message "jdk/vm/ci/services/Services",
    :at [org.graalvm.libgraal.LibGraal <clinit> "LibGraal.java" 46]}
   {:type java.lang.ClassNotFoundException,
    :message "jdk.vm.ci.services.Services",
    :at
    [jdk.internal.loader.BuiltinClassLoader
     loadClass
     "BuiltinClassLoader.java"
     606]}],
  :trace
  [[jdk.internal.loader.BuiltinClassLoader
    loadClass
    "BuiltinClassLoader.java"
    606]
   [jdk.internal.loader.ClassLoaders$AppClassLoader
    loadClass
    "ClassLoaders.java"
    168]
   [java.lang.ClassLoader loadClass "ClassLoader.java" 522]
   [org.graalvm.libgraal.LibGraal <clinit> "LibGraal.java" 46]
   [org.graalvm.compiler.truffle.runtime.hotspot.libgraal.LibGraalTruffleRuntimeAccess
    getPriority
    "LibGraalTruffleRuntimeAccess.java"
    44]
   [com.oracle.truffle.api.Truffle
    selectTruffleRuntimeAccess
    "Truffle.java"
    89]
   [com.oracle.truffle.api.Truffle access$000 "Truffle.java" 57]
   [com.oracle.truffle.api.Truffle$1 run "Truffle.java" 122]
   [com.oracle.truffle.api.Truffle$1 run "Truffle.java" 107]
   [java.security.AccessController
    doPrivileged
    "AccessController.java"
    312]
   [com.oracle.truffle.api.Truffle initRuntime "Truffle.java" 107]
   [com.oracle.truffle.api.Truffle <clinit> "Truffle.java" 62]
   [com.oracle.truffle.api.impl.Accessor getTVMCI "Accessor.java" 1092]
   [com.oracle.truffle.api.impl.Accessor
    access$000
    "Accessor.java"
    117]
   [com.oracle.truffle.api.impl.Accessor$Constants
    <clinit>
    "Accessor.java"
    974]
   [com.oracle.truffle.api.impl.Accessor
    nodeSupport
    "Accessor.java"
    1025]
   [com.oracle.truffle.api.LanguageAccessor
    <clinit>
    "LanguageAccessor.java"
    79]
   [com.oracle.truffle.api.TruffleLogger$LoggerCache
    <clinit>
    "TruffleLogger.java"
    957]
   [com.oracle.truffle.api.TruffleLogger
    getLogger
    "TruffleLogger.java"
    154]
   [com.oracle.truffle.api.TruffleLogger
    getLogger
    "TruffleLogger.java"
    138]
   [com.oracle.truffle.polyglot.PolyglotContextImpl
    <clinit>
    "PolyglotContextImpl.java"
    101]
   [com.oracle.truffle.polyglot.HostException
    <init>
    "HostException.java"
    58]
   [com.oracle.truffle.polyglot.PolyglotImpl
    <clinit>
    "PolyglotImpl.java"
    92]
   [jdk.internal.reflect.NativeConstructorAccessorImpl
    newInstance0
    "NativeConstructorAccessorImpl.java"
    -2]
   [jdk.internal.reflect.NativeConstructorAccessorImpl
    newInstance
    "NativeConstructorAccessorImpl.java"
    64]
   [jdk.internal.reflect.DelegatingConstructorAccessorImpl
    newInstance
    "DelegatingConstructorAccessorImpl.java"
    45]
   [java.lang.reflect.Constructor
    newInstanceWithCaller
    "Constructor.java"
    500]
   [java.lang.reflect.Constructor newInstance "Constructor.java" 481]
   [java.util.ServiceLoader$ProviderImpl
    newInstance
    "ServiceLoader.java"
    782]
   [java.util.ServiceLoader$ProviderImpl get "ServiceLoader.java" 724]
   [java.util.ServiceLoader$3 next "ServiceLoader.java" 1396]
   [org.graalvm.polyglot.Engine$1
    searchServiceLoader
    "Engine.java"
    747]
   [org.graalvm.polyglot.Engine$1 run "Engine.java" 733]
   [org.graalvm.polyglot.Engine$1 run "Engine.java" 707]
   [java.security.AccessController
    doPrivileged
    "AccessController.java"
    312]
   [org.graalvm.polyglot.Engine initEngineImpl "Engine.java" 707]
   [org.graalvm.polyglot.Engine access$000 "Engine.java" 106]
   [org.graalvm.polyglot.Engine$ImplHolder <clinit> "Engine.java" 115]
   [org.graalvm.polyglot.Engine getImpl "Engine.java" 304]
   [org.graalvm.polyglot.HostAccess$Builder
    targetTypeMapping
    "HostAccess.java"
    913]
   [com.oracle.truffle.js.scriptengine.GraalJSScriptEngine
    createNashornHostAccess
    "GraalJSScriptEngine.java"
    104]
   [com.oracle.truffle.js.scriptengine.GraalJSScriptEngine
    <clinit>
    "GraalJSScriptEngine.java"
    99]
   [com.oracle.truffle.js.scriptengine.GraalJSEngineFactory
    getScriptEngine
    "GraalJSEngineFactory.java"
    180]
   [com.oracle.truffle.js.scriptengine.GraalJSEngineFactory
    getScriptEngine
    "GraalJSEngineFactory.java"
    57]
   [javax.script.ScriptEngineManager
    getEngineByName
    "ScriptEngineManager.java"
    241]
   [shadow.cljs.devtools.server.npm_deps$make_engine
    invokeStatic
    "npm_deps.clj"
    16]
   [shadow.cljs.devtools.server.npm_deps$make_engine
    invoke
    "npm_deps.clj"
    11]
   [shadow.cljs.devtools.server.npm_deps$fn__17754$fn__17755
    invoke
    "npm_deps.clj"
    28]
   [clojure.lang.Delay deref "Delay.java" 42]
   [clojure.core$deref invokeStatic "core.clj" 2324]
   [clojure.core$deref invoke "core.clj" 2310]
   [shadow.cljs.devtools.server.npm_deps$fn__17754$fn__17757
    invoke
    "npm_deps.clj"
    34]
   [shadow.cljs.devtools.server.npm_deps$is_installed_QMARK_
    invokeStatic
    "npm_deps.clj"
    201]
   [shadow.cljs.devtools.server.npm_deps$is_installed_QMARK_
    invoke
    "npm_deps.clj"
    195]
   [shadow.cljs.devtools.server.npm_deps$main$fn__17849
    invoke
    "npm_deps.clj"
    221]
   [clojure.core$complement$fn__5686 invoke "core.clj" 1443]
   [clojure.core$filter$fn__5911 invoke "core.clj" 2825]
   [clojure.lang.LazySeq sval "LazySeq.java" 42]
   [clojure.lang.LazySeq seq "LazySeq.java" 51]
   [clojure.lang.RT seq "RT.java" 535]
   [clojure.core$seq__5419 invokeStatic "core.clj" 139]
   [clojure.core$seq__5419 invoke "core.clj" 139]
   [shadow.cljs.devtools.server.npm_deps$main
    invokeStatic
    "npm_deps.clj"
    223]
   [shadow.cljs.devtools.server.npm_deps$main
    invoke
    "npm_deps.clj"
    210]
   [shadow.cljs.devtools.cli_actual$main
    invokeStatic
    "cli_actual.clj"
    141]
   [shadow.cljs.devtools.cli_actual$main doInvoke "cli_actual.clj" 132]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.core$apply invokeStatic "core.clj" 671]
   [clojure.core$apply invoke "core.clj" 662]
   [shadow.cljs.devtools.cli_actual$_main
    invokeStatic
    "cli_actual.clj"
    219]
   [shadow.cljs.devtools.cli_actual$_main
    doInvoke
    "cli_actual.clj"
    217]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.core$apply invokeStatic "core.clj" 667]
   [clojure.core$apply invoke "core.clj" 662]
   [shadow.cljs.devtools.cli$_main invokeStatic "cli.clj" 75]
   [shadow.cljs.devtools.cli$_main doInvoke "cli.clj" 67]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [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 "jdk.vm.ci.services.Services"}}

pedrorgirardi07:05:30

It was generated by the Clojure CLI.

thheller07:05:30

yeah dunno. the graal-js engine has been in use for a while now (definitely long before 2.12.5) so I don't know why you'd be getting that error now

thheller07:05:50

always helps to sort out your dependency conflicts if you use project.clj or deps.edn

thheller07:05:01

might just be a classpath issue with a missing dependency or so

pedrorgirardi07:05:18

I'm on 2.12.5, so let me try to upgrade to 2.12.6 and then 2.12.7 just to see when it happens.

thheller07:05:28

nothing regarding any of this has changed

pedrorgirardi07:05:21

I just tried upgrading to 2.12.6 and I get the same error. I'm wondering what my be wrong with my setup.

thheller07:05:13

something JVM/classpath related, can't say more without more information about your overall setup

pedrorgirardi07:05:55

Sorry for the long output, but this is what I get with -Stree

thheller07:05:11

thats not interesting really

pedrorgirardi07:05:12

org.clojure/data.json 2.2.3
org.clojure/clojure 1.10.3
  . org.clojure/spec.alpha 0.2.194
  . org.clojure/core.specs.alpha 0.2.56
org.clojure/tools.logging 1.1.0
expound/expound 0.8.9
compojure/compojure 1.6.2
  . org.clojure/tools.macro 0.1.5
  . clout/clout 2.2.1
    . instaparse/instaparse 1.4.8
  . medley/medley 1.3.0
  X ring/ring-core 1.8.1 :use-top
  X ring/ring-codec 1.1.2 :superseded
    X commons-codec/commons-codec 1.11 :parent-omitted
org.slf4j/jcl-over-slf4j 1.7.30
  X org.slf4j/slf4j-api 1.7.30 :use-top
com.google.cloud/google-cloud-logging-logback 0.119.0-alpha
  X ch.qos.logback/logback-classic 1.2.3 :use-top
  . ch.qos.logback/logback-core 1.2.3
  . com.google.cloud/google-cloud-logging 2.0.1
  . com.google.guava/failureaccess 1.0.1
  . com.google.guava/listenablefuture 9999.0-empty-to-avoid-conflict-with-guava
  . com.google.code.findbugs/jsr305 3.0.2
  . org.checkerframework/checker-compat-qual 2.5.5
  . com.google.errorprone/error_prone_annotations 2.4.0
  . com.google.j2objc/j2objc-annotations 1.3
  . io.grpc/grpc-api 1.34.0
  . io.grpc/grpc-context 1.34.0
  . org.codehaus.mojo/animal-sniffer-annotations 1.19
  . io.grpc/grpc-stub 1.34.0
  . io.grpc/grpc-protobuf 1.34.0
  . io.grpc/grpc-protobuf-lite 1.34.0
  . javax.annotation/javax.annotation-api 1.3.2
  . com.google.auto.value/auto-value-annotations 1.7.4
  . com.google.protobuf/protobuf-java 3.14.0
  . com.google.protobuf/protobuf-java-util 3.14.0
  . com.google.code.gson/gson 2.8.6
  . com.google.api.grpc/proto-google-common-protos 2.0.1
  . com.google.api.grpc/proto-google-cloud-logging-v2 0.85.1
  . com.google.api/gax 1.60.1
  . io.opencensus/opencensus-api 0.24.0
  . com.google.api/gax-grpc 1.60.1
  . io.grpc/grpc-auth 1.34.0
  . com.google.auth/google-auth-library-credentials 0.22.0
  . io.grpc/grpc-netty-shaded 1.34.0
  . io.grpc/grpc-alts 1.34.0
  . io.grpc/grpc-grpclb 1.34.0
  X org.apache.commons/commons-lang3 3.5 :superseded
  . org.conscrypt/conscrypt-openjdk-uber 2.5.1
  . org.threeten/threetenbp 1.5.0
  . com.google.cloud/google-cloud-core-grpc 1.94.0
  . com.google.http-client/google-http-client-jackson2 1.38.0
  . com.fasterxml.jackson.core/jackson-core 2.12.0
  . com.google.http-client/google-http-client 1.38.0
  . org.apache.httpcomponents/httpclient 4.5.13
  . commons-logging/commons-logging 1.2
  X commons-codec/commons-codec 1.11 :superseded
  X org.apache.httpcomponents/httpcore 4.4.13 :superseded
  . io.opencensus/opencensus-contrib-http-util 0.24.0
  . io.grpc/grpc-core 1.34.0
  . com.google.android/annotations 4.1.1.4
  . io.perfmark/perfmark-api 0.19.0
  . com.google.api.grpc/proto-google-iam-v1 1.0.3
  X org.slf4j/slf4j-api 1.7.30 :use-top
  . com.google.api/api-common 1.10.1
  . com.google.cloud/google-cloud-core 1.94.0
  . com.google.auth/google-auth-library-oauth2-http 0.22.0
  X com.google.guava/guava 30.0-android :use-top
org.apache.logging.log4j/log4j-to-slf4j 2.14.1
  X org.slf4j/slf4j-api 1.7.25 :use-top
  . org.apache.logging.log4j/log4j-api 2.14.1
com.cognitect/anomalies 0.1.12
ring-cors/ring-cors 0.1.13
ring/ring-defaults 0.3.2
  X ring/ring-core 1.6.3 :use-top
  . ring/ring-ssl 0.3.0
    X ring/ring-core 1.6.0 :use-top
  . ring/ring-headers 0.3.0
    X ring/ring-core 1.6.0 :use-top
  . ring/ring-anti-forgery 1.3.0
    . crypto-random/crypto-random 1.2.0
    . crypto-equality/crypto-equality 1.0.0
    X hiccup/hiccup 1.0.5 :use-top
  . javax.servlet/javax.servlet-api 3.1.0
com.cognitect/transit-cljs 0.8.269
  . com.cognitect/transit-js 0.8.874
thheller/shadow-cljs 2.12.6
  X org.clojure/data.json 2.2.1 :use-top
  X org.clojure/tools.cli 1.0.194 :superseded
  . org.clojure/tools.reader 1.3.5
  . nrepl/nrepl 0.8.3
  . cider/piggieback 0.5.2
  X com.cognitect/transit-clj 1.0.324 :use-top
  X com.cognitect/transit-cljs 0.8.264 :use-top
  . org.clojure/core.async 1.3.610
    . org.clojure/tools.analyzer.jvm 1.1.0
      . org.clojure/tools.analyzer 1.0.0
      . org.clojure/core.memoize 1.0.236
        . org.clojure/core.cache 1.0.207
          . org.clojure/data.priority-map 1.0.0
      X org.ow2.asm/asm 5.2 :superseded
      X org.clojure/tools.reader 1.3.2 :older-version
  X org.clojure/clojurescript 1.10.844 :use-top
  . com.google.javascript/closure-compiler-unshaded v20210302
  . org.clojure/google-closure-library 0.0-20201211-3e6c510d
    . org.clojure/google-closure-library-third-party 0.0-20201211-3e6c510d
  . org.clojure/google-closure-library-third-party 0.0-20201211-3e6c510d
  . thheller/shadow-util 0.7.0
    X hiccup/hiccup 1.0.5 :use-top
  . thheller/shadow-client 1.3.3
    X org.clojure/core.async 0.3.443 :older-version
    X hiccup/hiccup 1.0.5 :use-top
  . thheller/shadow-undertow 0.1.0
    . org.clojure/core.async 1.3.610
    . io.undertow/undertow-core 2.2.4.Final
      . org.jboss.logging/jboss-logging 3.4.1.Final
      . org.jboss.xnio/xnio-api 3.8.0.Final
        . org.wildfly.common/wildfly-common 1.5.2.Final
        . org.wildfly.client/wildfly-client-config 1.0.1.Final
          X org.jboss.logging/jboss-logging 3.3.1.Final :older-version
          X org.wildfly.common/wildfly-common 1.2.0.Final :older-version
      . org.jboss.xnio/xnio-nio 3.8.0.Final
        . org.jboss.xnio/xnio-api 3.8.0.Final
          X org.jboss.threads/jboss-threads 2.3.3.Final :older-version
      . org.jboss.threads/jboss-threads 3.1.0.Final
        . org.jboss.logging/jboss-logging 3.4.1.Final
  X hiccup/hiccup 1.0.5 :use-top
  X ring/ring-core 1.9.2 :use-top
  . org.graalvm.js/js 21.0.0.2
    . org.graalvm.regex/regex 21.0.0.2
      . org.graalvm.truffle/truffle-api 21.0.0.2
    . org.graalvm.truffle/truffle-api 21.0.0.2
      . org.graalvm.sdk/graal-sdk 21.0.0.2
    . org.graalvm.sdk/graal-sdk 21.0.0.2
    . com.ibm.icu/icu4j 67.1
  . org.graalvm.js/js-scriptengine 21.0.0.2
    . org.graalvm.sdk/graal-sdk 21.0.0.2
  X expound/expound 0.8.5 :use-top
  X fipp/fipp 0.6.23 :use-top
  . com.bhauman/cljs-test-display 0.1.1
  . com.wsscode/pathom 2.2.31
    . com.wsscode/spec-inspec 1.0.0-alpha2
    . spec-coerce/spec-coerce 1.0.0-alpha6
      . com.wsscode/spec-inspec 1.0.0-alpha2
    . edn-query-language/eql 0.0.9
      X org.clojure/test.check 0.10.0-alpha3 :older-version
      X org.clojure/spec.alpha 0.2.176 :older-version
      X org.clojure/core.specs.alpha 0.2.44 :older-version
    X org.clojure/core.async 0.4.474 :older-version
    X org.clojure/test.check 0.10.0-alpha3 :older-version
  . org.clojure/test.check 1.1.0
  . thheller/shadow-cljsjs 0.0.21
org.clojure/clojurescript 1.10.844
  X org.clojure/data.json 0.2.6 :use-top
  X org.clojure/tools.reader 1.3.3 :older-version
  X com.cognitect/transit-clj 0.8.309 :use-top
com.stuartsierra/component 1.0.0
  . com.stuartsierra/dependency 1.0.0
fipp/fipp 0.6.23
  . org.clojure/core.rrb-vector 0.1.1
aero/aero 1.1.6
org.slf4j/jul-to-slf4j 1.7.30
  X org.slf4j/slf4j-api 1.7.30 :use-top
cljs-ajax/cljs-ajax 0.8.3
  . cheshire/cheshire 5.10.0
    X com.fasterxml.jackson.core/jackson-core 2.10.2 :older-version
    . com.fasterxml.jackson.dataformat/jackson-dataformat-smile 2.10.2
      X com.fasterxml.jackson.core/jackson-core 2.10.2 :older-version
    . com.fasterxml.jackson.dataformat/jackson-dataformat-cbor 2.10.2
      X com.fasterxml.jackson.core/jackson-core 2.10.2 :older-version
    . tigris/tigris 0.1.2
  X com.cognitect/transit-clj 1.0.324 :use-top
  X com.cognitect/transit-cljs 0.8.264 :use-top
  . org.apache.httpcomponents/httpasyncclient 4.1.4
    X org.apache.httpcomponents/httpcore 4.4.10 :older-version
    . org.apache.httpcomponents/httpcore-nio 4.4.10
      X org.apache.httpcomponents/httpcore 4.4.10 :older-version
    X org.apache.httpcomponents/httpclient 4.5.6 :older-version
    . commons-logging/commons-logging 1.2
  . org.apache.httpcomponents/httpcore 4.4.14 :newer-version
com.brunobonacci/mulog 0.6.5
  . amalloy/ring-buffer 1.3.1
zprint/zprint 1.1.2
  . rewrite-cljs/rewrite-cljs 0.4.5
    X org.clojure/tools.reader 1.3.2 :older-version
  X borkdude/edamame 0.0.11-alpha.28 :superseded
    X org.clojure/tools.reader 1.3.4 :older-version
  X borkdude/sci 0.2.1-alpha.1 :superseded
    X borkdude/sci.impl.reflector 0.0.1 :parent-omitted
    X borkdude/edamame 0.0.11-alpha.27 :parent-omitted
  . rewrite-clj/rewrite-clj 0.6.1
    X org.clojure/tools.reader 1.2.2 :older-version
hiccup/hiccup 1.0.5
org.apache.commons/commons-text 1.9
  . org.apache.commons/commons-lang3 3.11 :newer-version
com.google.guava/guava 30.0-jre
  . com.google.guava/failureaccess 1.0.1
  . com.google.guava/listenablefuture 9999.0-empty-to-avoid-conflict-with-guava
  . com.google.code.findbugs/jsr305 3.0.2
  . org.checkerframework/checker-qual 3.5.0
  X com.google.errorprone/error_prone_annotations 2.3.4 :older-version
  . com.google.j2objc/j2objc-annotations 1.3
datalevin/datalevin 0.4.31
  . org.clojure/tools.cli 1.0.206 :newer-version
  . borkdude/sci 0.2.4 :newer-version
    . borkdude/sci.impl.reflector 0.0.1
    . borkdude/edamame 0.0.11-alpha.29 :newer-version
      X org.clojure/tools.reader 1.3.4 :older-version
  X com.cognitect/transit-clj 1.0.324 :use-top
  . nrepl/bencode 1.1.0
  . com.taoensso/nippy 3.1.1
    X org.clojure/tools.reader 1.3.4 :older-version
    . com.taoensso/encore 3.9.2
      X org.clojure/tools.reader 1.3.3 :older-version
      . com.taoensso/truss 1.6.0
    . org.iq80.snappy/snappy 0.4
    . org.tukaani/xz 1.8
    . org.lz4/lz4-java 1.7.1
  . persistent-sorted-set/persistent-sorted-set 0.1.2
  . org.graalvm.nativeimage/svm 21.0.0.2
    . org.graalvm.nativeimage/svm-hosted-native-linux-amd64 21.0.0.2
    . org.graalvm.nativeimage/svm-hosted-native-darwin-amd64 21.0.0.2
    . org.graalvm.nativeimage/svm-hosted-native-windows-amd64 21.0.0.2
    . org.graalvm.sdk/graal-sdk 21.0.0.2
    . org.graalvm.nativeimage/objectfile 21.0.0.2
      . org.graalvm.compiler/compiler 21.0.0.2
    . org.graalvm.nativeimage/pointsto 21.0.0.2
      . org.graalvm.compiler/compiler 21.0.0.2
    . org.graalvm.truffle/truffle-nfi 21.0.0.2
      . org.graalvm.truffle/truffle-api 21.0.0.2
      . org.graalvm.truffle/truffle-nfi-native-linux-amd64 21.0.0.2
      . org.graalvm.truffle/truffle-nfi-native-linux-aarch64 21.0.0.2
      . org.graalvm.truffle/truffle-nfi-native-darwin-amd64 21.0.0.2
    . org.graalvm.compiler/compiler 21.0.0.2
      . org.graalvm.sdk/graal-sdk 21.0.0.2
      . org.graalvm.truffle/truffle-api 21.0.0.2
  . org.lmdbjava/lmdbjava 0.8.1
    . com.github.jnr/jnr-constants 0.9.15
    . com.github.jnr/jnr-ffi 2.1.15
      . com.github.jnr/jffi 1.2.23
      . com.github.jnr/jffi$native 1.2.23
      . org.ow2.asm/asm 7.1 :newer-version
      . org.ow2.asm/asm-commons 7.1
        . org.ow2.asm/asm 7.1
        . org.ow2.asm/asm-tree 7.1
        . org.ow2.asm/asm-analysis 7.1
      . org.ow2.asm/asm-analysis 7.1
        . org.ow2.asm/asm-tree 7.1
      . org.ow2.asm/asm-tree 7.1
        . org.ow2.asm/asm 7.1
      . org.ow2.asm/asm-util 7.1
        . org.ow2.asm/asm 7.1
        . org.ow2.asm/asm-tree 7.1
        . org.ow2.asm/asm-analysis 7.1
      . com.github.jnr/jnr-a64asm 1.0.0
      . com.github.jnr/jnr-x86asm 1.0.2

pedrorgirardi07:05:17

binaryage/devtools 1.0.3
re-frame/re-frame 1.2.0
  . reagent/reagent 1.0.0
    X cljsjs/react 17.0.1-0 :excluded
    X cljsjs/react-dom 17.0.1-0 :excluded
    X cljsjs/react-dom-server 17.0.1-0 :excluded
  . net.cgrand/macrovich 0.2.1
  X org.clojure/tools.logging 1.1.0 :use-top
com.cognitect/transit-clj 1.0.324
  . com.cognitect/transit-java 1.0.343
    X com.fasterxml.jackson.core/jackson-core 2.8.7 :older-version
    . org.msgpack/msgpack 0.6.12
      . com.googlecode.json-simple/json-simple 1.1.1
      . org.javassist/javassist 3.18.1-GA
    X commons-codec/commons-codec 1.10 :older-version
    . javax.xml.bind/jaxb-api 2.3.0
nano-id/nano-id 1.0.0
lambdaisland/glogi 1.0.106
org.slf4j/slf4j-api 1.7.30
metosin/reitit-frontend 0.5.13
  . metosin/reitit-core 0.5.13
    . meta-merge/meta-merge 1.0.0
ch.qos.logback/logback-classic 1.2.3
  . ch.qos.logback/logback-core 1.2.3
  X org.slf4j/slf4j-api 1.7.25 :use-top
ring/ring-mock 0.4.0
  X cheshire/cheshire 5.8.1 :older-version
  X ring/ring-codec 1.1.1 :older-version
org.slf4j/log4j-over-slf4j 1.7.30
  X org.slf4j/slf4j-api 1.7.30 :use-top
ring/ring-core 1.9.3
  . ring/ring-codec 1.1.3 :newer-version
    . commons-codec/commons-codec 1.15 :newer-version
  . commons-io/commons-io 2.6
  . commons-fileupload/commons-fileupload 1.4
    X commons-io/commons-io 2.2 :older-version
  . crypto-random/crypto-random 1.2.0
    X commons-codec/commons-codec 1.6 :older-version
  . crypto-equality/crypto-equality 1.0.0
world.convex/convex /Users/pedro/Developer/convex-dev/convex-web/convex.jar
  . org.apache.commons/commons-lang3 3.11
http-kit/http-kit 2.5.3

thheller07:05:15

the relevant graal js deps are there. try 2.12.4, I suspect that to be broken too

thheller07:05:26

maybe even delete .cpcache and 2.12.5 might be broken after too

borkdude07:05:14

@pedrorgirardi I suspect your error message has to do with deps in datalevin, it seems it pulls in GraalVM SVM: https://github.com/juji-io/datalevin/blob/4e699c5a45cc0013420b70afdf5dcb48199c25e1/project.clj#L35

borkdude07:05:07

I think datalevin should not be doing that, unless you build for graalvm

borkdude07:05:21

but perhaps he has reasons to do it, not sure

pedrorgirardi07:05:44

Yeah, that's a good point. Let me see if I can simply ignore it because I'm embedding Datelevin in my app.

pedrorgirardi07:05:03

And @thheller, 2.12.4 works fine too.

thheller07:05:51

ah in 2.12.6 I updated the graal-js dependency. so I guess thats the cause then

borkdude07:05:14

I think he only needs those deps when he compiles a native image: https://github.com/juji-io/datalevin/blob/ab421c34b9abee61ef574a57fb1c75f9033fbba2/native/src/java/datalevin/ni/Lib.java so I think it's worth pointing that out to him and try to get him to move the dep to a profile

borkdude07:05:35

oh you also have a graal-related dependency, hmm, that explains it probably

thheller07:05:01

just the graal-js scriptengine, not graalvm related

thheller07:05:15

jdk15 removed nashorn and graal-js was the replacement

borkdude07:05:41

but that is built on graalvm?

thheller07:05:14

@pedrorgirardi you can try manually adding [org.graalvm.js/js "21.1.0"] and [org.graalvm.js/js-scriptengine "21.1.0"]. maybe those fix it too (newer versions than shadow-cljs currently uses)

pedrorgirardi07:05:17

Hm, I tried tried:

datalevin/datalevin {:mvn/version "0.4.31"
                       :exclusions [org.graalvm.nativeimage/svm]}
but Daletinv complains about a ClassNotFound.

thheller07:05:21

no, not built on graalvm (as in the actual JVM)

pedrorgirardi07:05:10

Will add the dependencies @thheller.

borkdude07:05:11

fwiw datalevin uses 21.0.0.2

pedrorgirardi07:05:34

Yes @borkdude you right, that's what I have in my classpath

pedrorgirardi07:05:34

org.graalvm.nativeimage/svm 21.0.0.2

borkdude07:05:34

@huahaiy Please read this discussion when you are awake :) - there might be a way to exclude the graalvm specific deps in datalevin as a JVM lib

Huahai17:05:00

This is needed because I am using a GraalVM method to detect if we are running in GraalVM, which would use GraalVM specific binding for LMDB. Is there another reliable way to detect this?

borkdude17:05:18

You can detect this using a System property

Huahai17:05:29

which one?

Huahai17:05:00

`Boolean.getBoolean("com.oracle.graalvm.isaot")`?

borkdude17:05:05

bb -e '(clojure.pprint/pprint (into {} (System/getProperties)))'
{"babashka.version" "0.4.1-SNAPSHOT",
 "org.graalvm.nativeimage.kind" "executable",
 "path.separator" ":",
 "user.dir" "/Users/borkdude/dre/DocSearch/app",
 "java.vm.specification.vendor" "Oracle Corporation",
 "java.vendor.url" "",
 "java.specification.name" "Java Platform API Specification",
 "line.separator" "\n",
 "java.vm.version" "GraalVM 21.0.0 Java 11",
 "java.vendor" "Oracle Corporation",
 "java.specification.vendor" "Oracle Corporation",
 "java.vm.specification.version" "11",
 "java.io.tmpdir" "/var/folders/2m/h3cvrr1x4296p315vbk7m32c0000gp/T/",
 "java.class.path" "",
 "java.vm.vendor" "Oracle Corporation",
 "org.graalvm.nativeimage.imagecode" "runtime",
 "java.vm.name" "Substrate VM",
 "java.version" "11.0.10",
 "os.arch" "amd64",
 "user.home" "/Users/borkdude",
 "java.specification.version" "11",
 "java.ext.dirs" "",
 "sun.jnu.encoding" "UTF-8",
 "sun.arch.data.model" "64",
 "java.class.version" "55.0",
 "file.encoding" "UTF-8",
 "os.name" "Mac OS X",
 "os.version" "10.14.6",
 "jdk.lang.Process.launchMechanism" "FORK",
 "file.separator" "/",
 "java.vm.specification.name" "Java Virtual Machine Specification",
 "java.endorsed.dirs" "",
 "java.library.path" "",
 "user.name" "borkdude"}

borkdude17:05:13

let's see...

borkdude17:05:27

I think you can use "org.graalvm.nativeimage.kind" "executable"

borkdude17:05:49

or perhaps "org.graalvm.nativeimage.imagecode" "runtime"

borkdude17:05:19

I usually use one of both

Huahai17:05:34

ok, let me try that, thanks!

borkdude18:05:38

@huahaiy You can also make a top-level variable that captures one of your own environment variables during graalvm compilation

borkdude18:05:53

and then use that accordingly

Huahai03:05:12

@pedrorgirardi GraalVM dependencies are removed from Datalevin 0.4.34 JVM library

pedrorgirardi03:05:58

That’s great! Will upgrade to the latest version. Thank you @huahaiy .

pedrorgirardi03:05:36

And thank you once again for your help @borkdude . Really appreciated!

Huahai03:05:11

Please let me know if it works

pedrorgirardi03:05:01

Yep, it worked beautifully :)

🚀 3
thheller07:05:35

this is one of those situations where I recommend keeping your CLJS setup separate from your CLJ setup. way too annoying to deal with dependency conflicts such as this

pedrorgirardi07:05:36

Tests are passing with org.graalvm.js/js {:mvn/version "21.1.0"}, will try to upgrade Shadow CLJS now.

borkdude07:05:16

@thheller I think this shouldn't have happened in the first place, probably both dependencies should be opt-in

thheller07:05:21

if 21.1.0 fails just downgrade to 20.1.0 which is what 2.12.5 and before used

thheller07:05:42

maybe move datalevin to a CLJ specific alias that isn't used when running CLJS

pedrorgirardi07:05:21

That's a good idea!

pedrorgirardi07:05:32

But this fixed it

pedrorgirardi07:05:36

org.graalvm.js/js {:mvn/version "20.1.0"}
  org.graalvm.js/js-scriptengine {:mvn/version "20.1.0"}

pedrorgirardi07:05:19

I think I will try to move server only dependencies to its own alias 😐

👍 6
pedrorgirardi07:05:28

Thank you very much @thheller and @borkdude!

Aron10:05:24

daily fun: I am doing something wrong and hot reload results in an infinite loop eating up all my memory

Aron10:05:22

Holding Code references in State I am generating the UI, kinda a must to hold it in the state at some point.

thheller11:05:21

that likely is an invalid reference. holding on to some state does not cause an infinite loop

Aron11:05:43

it is an invalid reference according to some stack trace snippets, but I don't really understand what it says, and I am sure it's me doing the incorrect thing not some bug in the tools I use Uncaught TypeError: Cannot read property 'cljs$core$async$impl$protocols$WritePort$put_BANG_$arity$3' of null

Aron11:05:05

this is just one of the weird errors

thheller11:05:34

that error is a core.async put on nil

thheller11:05:04

(>! nil something)

Aron11:05:54

yes, thank you, I understand what you mean and it fits very well, I can easily imagine that react runs some piece of code that references to the old queue before the hot reload

Aron12:05:07

> shadow-cljs is rather strict about namespace references dunno, without the linter I wouldn't know half my imports are missing : D

Aron12:05:34

I thought putting defonce on the channel will solve this issue with the null, but no

thheller12:05:03

don't know what you are refering to

Aron12:05:42

put on nil. I thought that because the page is reloading out of order, some react registered thing on the callstack sees the channel I am putting on as nil, because it was removed from under it. So I defined the channel with defonce not def.

Aron12:05:30

but really, the bigger issue is that somehow the interaction between shadow-cljs hot reload and my react code results in a memory leak and kills my browser process

Aron12:05:37

it started when I pust unsub and close into the return functions of my react useEffect hooks, before that I only got the usual memory leak message from react that i am trying to do something with unmounted state, and I thought I am fixing something, but actually managed to make it worse

thheller12:05:55

one bug I can see is the (swap! timeouts conj @timeouts ...). remove the @timeouts

Aron12:05:31

thank you

thheller12:05:00

and I think the use-layout-effect is wrong, looks like it is missing a wrapping (fn [] ...)

thheller12:05:54

also you are always recur'ing, so there is never a check whether it should stop or not

Aron12:05:08

what would such a check look like

thheller12:05:33

(when-some [msg (<! notification-chan] ... (recur))

Aron13:05:27

my understanding was that inside go-loop, <! is blocking, if I close the channel, it should not call recur

thheller13:05:28

clearTimeouts is also using map lazy seq,so it never actually clears anything

thheller13:05:47

that is incorrect. when you take from a channel and that is closed it returns nil

Aron13:05:53

yeah, as you see, I was editing the code before I sent the screenshot

Aron13:05:07

I see, thanks for the correction

bartuka19:05:46

I am following a dynamic export (https://shadow-cljs.github.io/docs/UsersGuide.html#_dynamic_exports) to emit code to be used as node libraries and one of my forms is a defmacro. I currently get an error when I compile the code as Can't take the value of macro ...path-to-var what do I need to do here?

bartuka19:05:12

I already have (:require-macros [my.core.ns :refer [macro-var]) in top level

or19:05:25

@iagwanderson: I believe you need a (:require-macros [respondent.core]) in a respondent/core.cljs file, it requires the macros from its own namespace. I haven't done it in a .cljc file, but I guess you can just add it to the top there as well for :cljs.

bartuka19:05:21

I tried to add

#?(:cljs (:require-macros [cljs.core.async.macros :refer [go go-loop]]
                            [respondent.core :refer [behavior]]))
to the top and didnt work

bartuka20:05:29

I will read the post first.. interesting bit already: > > I strongly recommend writing your macros in 2 separate files until you feel comfortable with that. I still do it for 100% of my macros.

thheller20:05:35

yeah, cljc makes things a lot more complicated

bartuka20:05:42

Thanks for help @oliver and @thheller... getting closer to the answer here.. I do not have the error while compiling, but when I run the node.js script using the library it gives me undefined for the macro https://github.com/wandersoncferreira/respondent/blob/main/src/respondent/behavior.cljs

bartuka21:05:41

might be Gotcha #3 now 😃 will change it here...

bartuka22:05:58

@thheller I might have found the issue. I believe the first implementation was already good. However, if I try to refer to my macro anywhere other than in the first position of a form I get the same error Can't take value of macro.. .. I tried two things 1) calling my macro inside #js {:behavior (behavior)} export map and it worked! and 2) added (println (identity behavior)) to the code and got the same error Can't take value of macro.... maybe I cannot export macros ?

bartuka22:05:31

yeah, makes sense

Jacob Emcken21:05:36

I need my ClojureScript SPA to know of URL that differs from when I develop (run locally) and when the app gets deployed into production. I've been scrolling through the documentation... but nothing stands out to me as useful. I assume this is a quite common need, so I've come to conclusion that I just don't have the right terminology to find it. Can anyone give pointers?

Jacob Emcken22:05:28

I did stumble over shadow-env but it seemed overly complicated so I assumed there was a simpler (better?) way.

Jacob Emcken22:05:36

maybe let a single value point to a file path that gets read/included... then the file path points to an edn file?

Jacob Emcken22:05:23

hmmm :thinking_face: but it should all happen on build time.

Jacob Emcken22:05:04

Let's see if anyone else pitches in with ideas 😄

thheller06:05:54

your question really is a little vague. there are about hundreds of ways to do this, it really depends on your app and how you want to do it. :closure-defines would be the build-config driven variant. see also https://shadow-cljs.github.io/docs/UsersGuide.html#_release_specific_vs_development_configuration

thheller06:05:15

you can also get stuff from the HTML directly, or load if via fetch on startup. really far to many options to mention them all.