This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-15
Channels
- # aws (25)
- # babashka (11)
- # beginners (24)
- # calva (18)
- # clj-kondo (6)
- # cljdoc (1)
- # clojure (48)
- # clojure-europe (3)
- # clojure-houston (1)
- # clojure-uk (22)
- # clojuredesign-podcast (8)
- # clojurescript (9)
- # cursive (8)
- # dirac (6)
- # duct (19)
- # fulcro (17)
- # hoplon (29)
- # mount (3)
- # off-topic (24)
- # pathom (6)
- # re-frame (6)
- # shadow-cljs (5)
- # spacemacs (5)
- # sql (10)
- # tools-deps (7)
- # vim (2)
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]))
(comment
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?
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
.
For my setup the following is shown (in JVM-world):
(shadow/get-build-ids)
=> (: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(+ 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
{:paths
["src/"]
:deps
{reagent {:mvn/version "0.9.0-rc3"}
re-frame {:mvn/version "0.11.0-rc3"}
thheller/shadow-cljs {:mvn/version "2.8.81"}}
:aliases
{:dev {:extra-paths ["src/"]}}}
;; shadow-cljs.edn
{:deps
{:aliases [:dev]}
:builds
{:app
{:target :react-native
:init-fn my.ns/init
:output-dir "out"
:compiler-options {:infer-externs :auto}
:devtools {:autoload true}}}}