Fork me on GitHub

What’s the state on shadow-cljs support? I’m trying to send pretty basic things to the repl but it keeps crashing, ex

(ns my.ns
  (:require ["react-native" :as react-native]
            [reagent.core :as reagent]))


  reagent.core => #js{...}

  (reagent/adapt-react-class react-native/View) => #object[reagent.impl.template.NativeWrapper]

  react-native => Error handling response - class java.lang.ClassCastException: class clojure.lang.PersistentVector cannot be cast to class java.lang.CharSequence (clojure.lang.PersistentVector is in unnamed module of loader .PluginClassLoader @61776d58; java.lang.CharSequence is in module java.base of loader 'bootstrap')


You shouldn’t get an exception there. Just to be clear, it’s the symbol react-native that you’re sending to the REPL, right?


What does your shadow-cljs.edn look like?


I can try to reproduce that.

Ivar Refsdal12:03:09

I don't know your exact case @U0H9BVB98, but it looks like your REPL evaluation happens in JVM-world (not JS/browser). Have you tried evaluating something like (shadow/repl :client) before loading the statement? Where :client is the profile from :builds in shadow-cljs.edn.

Ivar Refsdal12:03:56

For my setup the following is shown (in JVM-world):

=> (:npm :client :devcards :server :test :test-ci)

(shadow/repl :client)
To quit, type: :cljs/quit
=> [:selected :client]
And after this I have my piggiebacked REPL

Ivar Refsdal12:03:50

(+ 1 "asdf")
Execution error (ClassCastException) at shadow.user/eval33505 (REPL:1).
class java.lang.String cannot be cast to class java.lang.Number (java.lang.String and java.lang.Number are in module java.base of loader 'bootstrap')

(shadow/repl :client)
To quit, type: :cljs/quit
=> [:selected :client]

(+ 1 "asdf")
------ WARNING - :invalid-arithmetic -------------------------------------------
 Resource: :1:1
 cljs.core/+, all arguments must be numbers, got [number string] instead
=> "1asdf"
I ❤️ JS 😉


@U0567Q30W Yes it’s the symbol I’m evaluating


 {reagent              {:mvn/version "0.9.0-rc3"}
  re-frame             {:mvn/version "0.11.0-rc3"}
  thheller/shadow-cljs {:mvn/version "2.8.81"}}

 {:dev {:extra-paths ["src/"]}}}

;; shadow-cljs.edn
 {:aliases [:dev]}

  {:target           :react-native
   :init-fn          my.ns/init
   :output-dir       "out"
   :compiler-options {:infer-externs :auto}
   :devtools         {:autoload true}}}}