Clojurescript: repl-incompatible symbols

I’m using a library that provides TimelineChart.TYPE.POINT which, when entered in the browser console, returns Symbol(). Trouble is, whenever I attempt to do repl-driven development with it my repl errors when asked to display something with these symbols, throwing “Cannot convert Symbol to string.” This is a serious wrench in my workflow because the thing works in the browser (does its job), but my development as I massage my data-structures is all out-of-flow. I’m guessing that Symbol() needs some toString on it? Can anyone tell me what’s going on here?

I always add the following snippet in my “user” namespace loaded by the repl

(ns cljs.user)

(extend-type js/Symbol
  (-pr-writer [obj writer _]
    (write-all writer (str "#object[" (.toString obj) "]"))))
1 Like

I don’t use a user.cljs, but I stuck that somewhere and it works. Thanks!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.