Fork me on GitHub
#datascript
<
2022-12-14
>
RJ Sheperd21:12:09

Bit of a specific question, but Iā€™m shuttling datoms over the wire and initializing DataScript using d/conn-from-datoms . I keep getting this error in the Browser console:

Uncaught ReferenceError: sb__40960__auto__ is not defined
    at me$tonsky$persistent_sorted_set$from_sorted_array (persistent_sorted_set.cljs:924:39)
    at Function.cljs$core$IFn$_invoke$arity$2 (db.cljc:808:24)
    at datascript$db$init_db (db.cljc:796:1)
    at Function.cljs$core$IFn$_invoke$arity$2 (core.cljc:453:35)
    at datascript$core$conn_from_datoms (core.cljc:450:1)
    at my_app$store$init_BANG_ (store.cljs:87:20)
    at re_frame$fx$do_fx_after (fx.cljc:59:23)
    at re_frame$interceptor$invoke_interceptor_fn (interceptor.cljc:70:6)
    at re_frame$interceptor$invoke_interceptors (interceptor.cljc:108:24)
    at re_frame$interceptor$execute (interceptor.cljc:201:8)
Some things to note: 1. All datoms are being exported from a DataHike database 2. All datoms have the same tx-id

Niki15:12:30

Are the types compatible? They have to be DataScript datoms

RJ Sheperd16:12:59

They should be. I am splitting the DataHike datoms into vectors, shipping those vectors to the browser via an AJAX call, and then instantiating them into DS datoms using datascript.core/datom

Niki22:12:35

What if you just do

(d/conn-from-datoms
  [(d/datom 1 :age  17)
   (d/datom 1 :name "Ivan")])
?

RJ Sheperd01:12:10

Turns out I had a bad schema file all along. Thanks for the response šŸ˜‰

šŸ‘ 3