shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
caleb.macdonaldblack 2021-05-14T05:03:06.217900Z

My coworker and I are experiencing this bug: https://github.com/thheller/shadow-cljs/issues/877

caleb.macdonaldblack 2021-05-14T05:03:53.218900Z

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

caleb.macdonaldblack 2021-05-14T05:04:01.219200Z

We’ve tried running a new shell as well

caleb.macdonaldblack 2021-05-14T05:05:12.220200Z

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.macdonaldblack 2021-05-14T05:19:15.220900Z

I had to update any deps using goog.isBoolean.

pedrorgirardi 2021-05-14T07:04:20.223400Z

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?

thheller 2021-05-14T07:07:27.224100Z

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

thheller 2021-05-14T07:07:54.224600Z

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

pedrorgirardi 2021-05-14T07:11:32.225300Z

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

pedrorgirardi 2021-05-14T07:12:01.225800Z

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

pedrorgirardi 2021-05-14T07:12:59.226500Z

It's loooong file, but this might help

pedrorgirardi 2021-05-14T07:13:05.226700Z

{: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"}}

pedrorgirardi 2021-05-14T07:13:30.227200Z

It was generated by the Clojure CLI.

thheller 2021-05-14T07:17:30.227900Z

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

thheller 2021-05-14T07:17:50.228500Z

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

thheller 2021-05-14T07:19:01.229600Z

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

pedrorgirardi 2021-05-14T07:19:18.230Z

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.

thheller 2021-05-14T07:20:28.230400Z

nothing regarding any of this has changed

pedrorgirardi 2021-05-14T07:21:21.231300Z

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

thheller 2021-05-14T07:23:13.232700Z

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

pedrorgirardi 2021-05-14T07:23:55.233200Z

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

thheller 2021-05-14T07:24:11.233700Z

thats not interesting really

pedrorgirardi 2021-05-14T07:24:12.233800Z

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

pedrorgirardi 2021-05-14T07:24:17.234Z

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

thheller 2021-05-14T07:25:15.234800Z

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

thheller 2021-05-14T07:25:26.235100Z

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

pedrorgirardi 2021-05-14T07:26:10.235600Z

Let me try

borkdude 2021-05-14T07:27:14.236100Z

@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

pedrorgirardi 2021-05-14T07:27:57.236500Z

True @borkdude!

borkdude 2021-05-14T07:28:07.236800Z

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

borkdude 2021-05-14T07:28:21.237100Z

but perhaps he has reasons to do it, not sure

pedrorgirardi 2021-05-14T07:29:44.238200Z

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

pedrorgirardi 2021-05-14T07:30:03.238600Z

And @thheller, 2.12.4 works fine too.

thheller 2021-05-14T07:30:22.238800Z

odd

thheller 2021-05-14T07:31:51.239500Z

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

borkdude 2021-05-14T07:32:14.240Z

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

borkdude 2021-05-14T07:32:35.240500Z

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

thheller 2021-05-14T07:33:01.241Z

just the graal-js scriptengine, not graalvm related

thheller 2021-05-14T07:33:15.241400Z

jdk15 removed nashorn and graal-js was the replacement

borkdude 2021-05-14T07:33:41.241800Z

but that is built on graalvm?

thheller 2021-05-14T07:34:14.242600Z

@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)

pedrorgirardi 2021-05-14T07:34:17.242900Z

Hm, I tried tried:

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

thheller 2021-05-14T07:34:21.243Z

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

pedrorgirardi 2021-05-14T07:35:10.243900Z

Will add the dependencies @thheller.

borkdude 2021-05-14T07:35:11.244Z

fwiw datalevin uses 21.0.0.2

pedrorgirardi 2021-05-14T07:35:34.244500Z

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

pedrorgirardi 2021-05-14T07:35:34.244700Z

org.graalvm.nativeimage/svm 21.0.0.2

borkdude 2021-05-14T07:36:34.245400Z

@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

Huahai 2021-05-16T03:35:12.313300Z

@pedrorgirardi GraalVM dependencies are removed from Datalevin 0.4.34 JVM library

pedrorgirardi 2021-05-16T03:36:58.314700Z

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

pedrorgirardi 2021-05-16T03:37:36.315600Z

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

Huahai 2021-05-16T03:38:11.315800Z

Please let me know if it works

pedrorgirardi 2021-05-16T03:40:48.316200Z

Will do.

pedrorgirardi 2021-05-16T03:47:01.317Z

Yep, it worked beautifully :)

🚀 1
thheller 2021-05-14T07:37:35.246800Z

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

pedrorgirardi 2021-05-14T07:37:36.246900Z

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

borkdude 2021-05-14T07:38:16.247700Z

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

thheller 2021-05-14T07:38:21.247900Z

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

pedrorgirardi 2021-05-14T07:38:42.248200Z

Ok

thheller 2021-05-14T07:41:42.249400Z

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

pedrorgirardi 2021-05-14T07:42:21.249700Z

That's a good idea!

pedrorgirardi 2021-05-14T07:42:32.250400Z

But this fixed it

pedrorgirardi 2021-05-14T07:42:36.250600Z

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

pedrorgirardi 2021-05-14T07:43:19.251200Z

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

👍 2
pedrorgirardi 2021-05-14T07:43:28.251600Z

Thank you very much @thheller and @borkdude!

Aron 2021-05-14T10:26:24.252400Z

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

Aron 2021-05-14T10:31:22.253100Z

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

thheller 2021-05-14T11:04:21.253500Z

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

Aron 2021-05-14T11:06:43.254500Z

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

Aron 2021-05-14T11:07:05.255Z

this is just one of the weird errors

thheller 2021-05-14T11:07:34.255400Z

that error is a core.async put on nil

Aron 2021-05-14T11:07:58.255800Z

hmm

thheller 2021-05-14T11:08:04.256Z

(>! nil something)

Aron 2021-05-14T11:08:54.257Z

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

Aron 2021-05-14T12:03:07.257800Z

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

Aron 2021-05-14T12:46:34.258300Z

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

thheller 2021-05-14T12:47:03.258500Z

don't know what you are refering to

Aron 2021-05-14T12:48:42.260100Z

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.

Aron 2021-05-14T12:49:30.260800Z

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

Aron 2021-05-14T12:50:37.262Z

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

Aron 2021-05-14T12:51:43.262200Z

https://i.imgur.com/vT6qiNq.png

thheller 2021-05-14T12:52:55.263100Z

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

Aron 2021-05-14T12:53:29.263500Z

🙂

Aron 2021-05-14T12:53:31.263700Z

thank you

thheller 2021-05-14T12:54:00.264500Z

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

thheller 2021-05-14T12:56:54.265Z

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

Aron 2021-05-14T12:59:08.265300Z

what would such a check look like

thheller 2021-05-14T12:59:33.265600Z

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

Aron 2021-05-14T13:02:27.266600Z

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

thheller 2021-05-14T13:02:28.266800Z

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

thheller 2021-05-14T13:02:47.267400Z

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

Aron 2021-05-14T13:02:53.267600Z

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

Aron 2021-05-14T13:03:07.267800Z

I see, thanks for the correction

Huahai 2021-05-14T17:53:00.277Z

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?

borkdude 2021-05-14T17:55:18.277200Z

You can detect this using a System property

Huahai 2021-05-14T17:55:29.277400Z

which one?

Huahai 2021-05-14T17:56:00.277600Z

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

borkdude 2021-05-14T17:56:05.277800Z

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" "<https://www.graalvm.org/>",
 "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"}

borkdude 2021-05-14T17:56:13.278Z

let's see...

borkdude 2021-05-14T17:56:27.278200Z

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

borkdude 2021-05-14T17:56:49.278400Z

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

borkdude 2021-05-14T17:57:19.278700Z

I usually use one of both

Huahai 2021-05-14T17:57:34.278900Z

ok, let me try that, thanks!

borkdude 2021-05-14T18:27:38.279100Z

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

borkdude 2021-05-14T18:27:53.279300Z

and then use that accordingly

bartuka 2021-05-14T19:01:46.281400Z

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?

bartuka 2021-05-14T19:02:12.282Z

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

bartuka 2021-05-14T19:38:20.282600Z

I made the code available online https://github.com/wandersoncferreira/respondent/blob/c420359ca838c510d0183be3452c293d137cd9b2/src/respondent/core.cljc#L127 this is the macro I want to export

oliver 2021-05-14T19:45:25.284300Z

@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.

bartuka 2021-05-14T19:50:21.284500Z

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

oliver 2021-05-14T20:00:38.284700Z

I don't think you need the :refer, but I also don't expect that to be the issue. I don't have any specific ideas, but check out https://code.thheller.com/blog/shadow-cljs/2019/10/12/clojurescript-macros.html, if you haven't yet.

thheller 2021-05-14T20:01:19.285300Z

@iagwanderson https://code.thheller.com/blog/shadow-cljs/2019/10/12/clojurescript-macros.html missing the self-require as oliver said

bartuka 2021-05-14T20:05:29.285900Z

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.

thheller 2021-05-14T20:06:35.286200Z

yeah, cljc makes things a lot more complicated

bartuka 2021-05-14T20:56:42.287300Z

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

bartuka 2021-05-14T21:03:41.287900Z

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

Jacob Emcken 2021-05-14T21:58:36.291900Z

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?

bartuka 2021-05-14T22:00:58.292Z

@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 ?

oliver 2021-05-14T22:11:45.292300Z

@jacob429: probably the easiest way is to use a Closure define: https://shadow-cljs.github.io/docs/UsersGuide.html#closure-defines, so for instance in a namespace my.config you do: (goog-define some-url "<http://localhost:8091/whatever>") and then in the release build you can set it via :compiler-options {:closure-defines {my.config/some-url "<https://prod-url>"}} or you override this via CLI with --merge-config.

oliver 2021-05-14T22:13:11.292500Z

I've also used shadow-env and aero before to put this into EDN files and load at compile time, see: https://github.com/mhuebert/shadow-env#example-usage-with-aero, but just today I replaced all of that with Closure defines, because the dev config always bled into the release build if there was a watch process running.

oliver 2021-05-14T22:13:29.292800Z

If anyone else has a better setup for this, then I'd be interested in that as well!

oliver 2021-05-14T22:19:10.293Z

Ah, @iagwanderson, I hadn't looked at the rest of the thing. I don't think exporting a macro makes sense. What would JS do with that? The macro is expanded at CLJS compile time. Hence the error message that you can't take its value.

Jacob Emcken 2021-05-14T22:21:28.293200Z

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

oliver 2021-05-14T22:22:23.293400Z

Yeah, the Closure defines probably are your best bet. But note that they can only be... err... I think booleans, numbers, or strings.

oliver 2021-05-14T22:24:30.293600Z

I had some config that needed more structure, like a map and list, so I defined some defines like value-1, value-2, value-3 and in the same config namespace did (def that-data {:key-1 value-1, :key-2 value-2, ...}). There might be a smarter way, but I don't know it.

bartuka 2021-05-14T22:26:31.293800Z

yeah, makes sense

Jacob Emcken 2021-05-14T22:37:36.294Z

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

Jacob Emcken 2021-05-14T22:38:23.294200Z

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

Jacob Emcken 2021-05-14T22:39:04.294400Z

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