I’m having trouble with having my data view JavaScript queries resulting in an evaluation errors for reading a property due for tasks. This is making most of my task management Impossible on the mobile. Tasks used to be rendered properly before updating obsidian to version 1.3.2
Could you post a couple examples of your what your task definitions look like, and an example of a query that throws this error? That would help a lot in understanding what the problem might be.
Hi @Craig, my tasks are setup as below and the query i use to pull relevant tasks in a daily note. I’ll also post a screenshot from my computer of the same query that works on my desktop setup.
My vault(folder) is on a NAS that keeps the folder synced on all my devices.
[ ] Task example one 2022-11-28 [p::[[Ali]]], [r::Family], [i::], [c::p], [e::l],
[ ] Task example two 2022-11-28 [p::[[Person]]], [r::[[A note]]], [i::], [c::o], [e::l],
I also have a couple of variations of this query for my weekly note too.
let n = luxon.DateTime.now() //current date-time
let inc_tasks = dv.pages(-'"/Journal/Daily"').file.tasks.filter(t => t.due
&& !t.completed
&& t.due >= dv.luxon.DateTime.fromFormat(dv.current().file.name,"yyyy-MM-dd")
&& t.due <= dv.luxon.DateTime.fromFormat(dv.current().file.name,"yyyy-MM-dd")
&& t.i !='parked') //incomplete tasks
for (let related of inc_tasks.groupBy(t => t.r)){
dv.header(6,related.key);
dv.taskList(
inc_tasks.filter(t =>
//Math.floor(n.diff(t.due,'days').days) == 0
//&&
//t.c == category.key
//&&
dv.func.choice(
dv.func.typeof(t.r) === "link",
dv.func.contains(t.r, related.key),
t.r === related.key
)
).sort( t => t.i, 'desc', t.due, 'asc')
,false
)
}
OK, thanks, that’s helpful, thank you. I was able to reproduce your situation. I saw a similar error at first, but then the query started producing results. I restarted Obsidian and got the error, but after closing and re-opening the page a few times I started getting results.
This is a tough one! My best guess is that there is some kind of race condition where Obsidian or Dataview hasn’t finished indexing pages before your query runs. I don’t know enough about the internals of either to speculate further.