Fork me on GitHub
#reagent
<
2020-01-03
>
dazld10:01:06

made a simple PR

dazld10:01:20

if there’s a better way to get this kind of debug info, would be welcome to ideas too!

dazld10:01:51

I guess in this case (and probably others) then the assert message could/should include as much information as possible from the arguments to r/cursor - in this case, path should be plain data, which is easier to locate than resolving a possibly nil var

Eric Ihli21:01:10

Any idea why I would be getting this in my REPL?

ezmonic.views=> (r/as-element [:strong "world"])
== JS EXCEPTION ==============================
ENCODING FAILED, check host console
==============================================

Eric Ihli21:01:35

I can't figure out what "host console" it refers to, but I don't see any output in the watchers or connected browser's devtools.

p-himik21:01:47

Browser JS console?

p-himik21:01:59

Ah, misread the last portion.

p-himik21:01:42

Well, it should end up in there:

(catch :default e
          (js/console.log "encoding of result failed" e ret)
          (assoc result :error "ENCODING FAILED, check host console"))

p-himik21:01:06

Are you sure you don't have any filters in the browser's devtools console panel?

p-himik21:01:47

Or maybe something is overriding js/console.log with something else. Can you use console.log() in the devtools, does it output its arguments right there?

Eric Ihli21:01:35

console.log in the FF devtools works fine. I have no filters.

Eric Ihli21:01:50

This is react native, so it would be in the browser tab that Metro is running in?

Eric Ihli21:01:52

Another thing...

[:> View
 (for [[number mnemonic] {"123" 123 "456" 456}]
  [:> Text number])]
This blows up during render with > TypeError: can't convert symbol to string The following works.
[:> View
 (for [[number mnemonic] {"123" 123 "456" 456}]
  [(r/adapt-react-class Text) number])]
Any idea why? I feel like knowing the answer would help my understanding of what's going on behind the scenes.

Eric Ihli21:01:38

That's what I was testing when I found the "ENCODING FAILED" error. I can evaluate the second form in my REPL but the first fails with the encoding failed message.

Eric Ihli22:01:28

Huh... Narrowing in on something.

ezmonic.views=> (require '["react-native" :as rn])
nil
ezmonic.views=> rn/Text
== JS EXCEPTION ==============================
ENCODING FAILED, check host console
==============================================
ezmonic.views=> rn/Button
#object[Button]