I'm getting a "Lookup ref attribute should be marked as :db/unique" but only with advanced compilation. It's driving me crazy.
Not looking for answers but is there a support group I can join?
@olivergeorge shot in the dark, but this helped me when I was having advanced compilation trouble with DataScript: https://github.com/tonsky/datascript/wiki/Tips-&-tricks#externs-and-shadow-cljs
Not sure about a support group other than here.
Thanks for sharing @cjsauer. Not using shadow-cljs and I think externs are where they should be ... we'll see. I need to get to a minimal test case.
Here's my test case.
(let [db (d/empty-db {:sighting/id {:db/unique :db.unique/identity}
:user/sightings {:db/cardinality :db.cardinality/many :db/valueType :db.type/ref}})
tx-data [{:user/sightings [{:sighting/id 123}]}]]
(try (d/db-with db tx-data)
(js/alert "Success")
(catch js/Object e
(js/alert (.-message e)))))
Really hoping someone will tell me I'm doing something obvious.
Fails with this error "Lookup ref should contain 2 elements: [{:sighting/id 123}]"
But only fails with iOS simulator running release configuration.
So it seems like some assumption in the CLJS code isn't always true.
It's a re-natal project.
Need to do more testing of combinations etc.