blacksmithgu / obsidian-dataview

A data index and query language over Markdown files, for https://obsidian.md/.
https://blacksmithgu.github.io/obsidian-dataview/
MIT License
6.94k stars 411 forks source link

Bug report #2165

Open JustasTamulis opened 10 months ago

JustasTamulis commented 10 months ago

What happened?

dv.table occasionally stopped working today, therefore upgraded both obsidian and dataview. Now all of my table queries stopped working.

The list also does not work, span does work.

The error for the table

Evaluation Error: TypeError: d is not a function
    at q$1 (plugin:dataview:14861:1597)
    at b$1.TableGrouping [as constructor] (plugin:dataview:15416:20)
    at b$1.B$2 [as render] (plugin:dataview:14859:8935)
    at L$1 (plugin:dataview:14859:6523)
    at P$1 (plugin:dataview:14859:2215)
    at L$1 (plugin:dataview:14859:6742)
    at P$1 (plugin:dataview:14859:2215)
    at L$1 (plugin:dataview:14859:6742)
    at D$1 (plugin:dataview:14859:9062)
    at ReactRenderer.onload (plugin:dataview:15103:9)

The error for the list

Evaluation Error: TypeError: d is not a function
    at q$1 (plugin:dataview:14861:1597)
    at b$1.RawLit [as constructor] (plugin:dataview:14946:21)
    at b$1.B$2 [as render] (plugin:dataview:14859:8935)
    at L$1 (plugin:dataview:14859:6523)
    at P$1 (plugin:dataview:14859:2215)
    at L$1 (plugin:dataview:14859:6742)
    at P$1 (plugin:dataview:14859:2215)
    at N$1 (plugin:dataview:14859:8066)
    at L$1 (plugin:dataview:14859:7055)
    at P$1 (plugin:dataview:14859:2215)

DQL

No response

JS

dv.table(["test"], [1,2,3])

Dataview Version

0.5.64

Obsidian Version

1.4.16

OS

Windows

holroy commented 10 months ago

This is actually a syntax error. The values element for dv.table() is supposed to be an array of rows where each row is an array of the columns. You're just presenting an array of 3 numerical elements, which doesn't meet those requirements. It would be easier to spot if you didn't just do a single column table, as the following is obviously correct syntax:

dv.table(["col1", "col2"],  [ [1, "one"], [2, "two"] ])

The following does indeed work:

dv.table(["test"], [ [1], [2], [3] ])

Or if you want just one row:

dv.table(["test"], [ [1, 2, 3] ])