Fork me on GitHub
#datascript
<
2015-09-06
>
bmaddy14:09:09

I've spent a number of hours now trying to get a basic datascript example working. Can anyone see what I'm going wrong? I start lein figwheel, refresh my browser and run this:

cljs.user=> (require '[datascript :as d])
cljs.user=> (d/create-conn {})
#<TypeError: Cannot read property 'call' of undefined>
The project is so simple that I'm sure I must be making a silly mistake. Here's the repo: https://github.com/bmaddy/prochaine Has anyone else run into this error?

jaen14:09:35

Hmm, interesting, the code looks good to me

bmaddy14:09:14

I originally thought it was this issue: https://github.com/tonsky/datascript/issues/57, but changing the namespace from prochaine.datascript to prochaine.ds didn't fix things.

bmaddy14:09:51

I've tried a number of cljs and datascript versions also, with no luck.

bmaddy15:09:13

Thanks for taking a look!

jaen15:09:24

I tried to see if updating clojurescript & datascript would help, but that seems to break your om version ; /

bmaddy15:09:21

Yeah, I tried playing around with a bunch of versions also with no luck.

jaen15:09:18

Hm, is there any new clojar for that?

jaen15:09:23

This one seems to have a syntax error

jaen15:09:46

I mean, for om

bmaddy15:09:42

This version works without datascript, I think specifically with clojurescript version 0.0-3308.

jaen15:09:01

Yeah, but it breaks with newest Clojurescript (122)

jaen15:09:13

Which I tried just now

bmaddy15:09:17

Ah, gotcha.

jaen15:09:29

Let me try a checkout dependency then

bmaddy15:09:41

I'm trying all cljs versions from the newest down to the first one that works to see if that helps.

bmaddy15:09:01

Just so you know, I'm going to need to take off in a minute or two.

jaen15:09:30

Sure, if I figure something out I'll leave a message here

bmaddy15:09:50

It looks like cljs 0.0-3308 is the newest release that works with that version of om.

bmaddy15:09:23

Ok, I need to take off. Thanks again for taking a quick look at this--I really appreciate it!

bmaddy15:09:57

Someone in #C03S1L9DN said upgrading figwheel to 0.3.9 fixes it. I'll try that when I get back. Thanks again for your help!

jaen15:09:01

@bmaddy: I got this working. What I did in order: 1. updated datascript to 0.11.6 and clojurescript to 1.7.122 2. this broke om (due to the syntax error I linked) so I had to use om as a checkout dependency - https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#checkout-dependencies - and account for some changes in the latest version 3. om was fixed, but datascript still didn't load; I updated figwheel to 0.3.9 but it didn't help either 4. I added {:warnings {:single-segment-namespace false}} to compiler options and this finally did it

jaen15:09:30

If I were you I'd first try doing 4. and see if it helps

jaen15:09:43

It just might, since I think figwheel refuses to load code with warnings

jaen15:09:51

And datascript will produce single segment namespace warnings