datascript

RJ Sheperd 2022-12-14T21:32:09.786309Z

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

RJ Sheperd 2022-12-22T01:50:10.898889Z

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

šŸ‘ 2
Niki 2022-12-15T15:03:30.279219Z

Are the types compatible? They have to be DataScript datoms

RJ Sheperd 2022-12-15T16:05:59.575559Z

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

Niki 2022-12-15T22:33:35.348369Z

What if you just do

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