Dataview queries vanishing

Things I have tried

Hi!
My dataview queries just disappear. The code only shows while editing, otherwise it is invisible, without error messages or results.
Apparently this query

list file.inlinks
where file=this.file

makes every query in my vault crash. Excetp for a dataviewjs.
Its funny, because I have no new queries. I have used this specific one for a couple of months.

The code only shows while editing because you’re using the Live Preview, not the source mode. To check the results, see if you have the same results in Reading mode.

About your query, it seems fine, it isn’t the issue source.
You can adjust it with the next query , but it’s just an adjustment, not the solution to solve any issue:

LIST WITHOUT ID InLinks
WHERE file.path = this.file.path
FLATTEN file.inlinks AS InLinks

Nope. It the results doesn’t show either in preview or edit mode. And it was woriking fine until last week give or take. It’s weird because I don’t even get an error message.
In source mode I get to see the code as if editing.

Some basic troubleshooting. (Sorry if these seem pedantic, but sometimes I miss the obvious until someone points it out to me.):

  • Is the Dataview plugin installed?
  • Is the Daraview plugin enabled?
  • Does the query start with ```dataview on its own line and end with ``` on its own line ?
  • Have you tried disabling all plugins except Dataview?
  • Have you tried installing Dataview into the sandbox vault and testing there?
  • Do inline queries work, e.g. `= this.file.link` ?
  • Have you tried using the default theme?
  • Have you tried disabling all custom CSS snippets?

1, 2 and 3 yes. I had all my queries working. But I can’t pinpoint exactly when it started to fail.
Disabling all other plugins worked. I found a plugin I installed and didn’t even use or or configure yet was the issue. I wasn’t expecting that. Thanks!
Commander plugin. It helps with mobile Obsidian, makes the toolbar more useful and customizable somehow.

Thank you very much!

1 Like

Solution 4 worked briefly. Now the issue is happening again.
I never messed with themes or css.
The crash only happen when I open files with some queries. I just tested more carefully, and the offending query is the dataviewjs that still works when everything else crashes. The start of the issue matches when I started using this query. Maybe its it:


const today = dv.func.date('today');

const nascimento = dv.current().nascimento;

function difference(d1, d2) {

  var m = moment(d1);

  var anos = m.diff(d2, 'years');

  m.add(-anos, 'years');

  var meses = m.diff(d2, 'months');

  m.add(-meses, 'months');

  var days = m.diff(d2, 'days');

  return {anos: anos, meses: meses, dias: days};

}

y = difference(Date.parse(today), Date.parse(nascimento));

dv.span(y)

I know nothing of dataviewjs. I just translated part of what I got ready in the forum. Maybe I poked somewhere I shouldn’t…

Were you able to fix this problem? I’m noticing that it happens every time I enable dataviewjs. Disabling it and restarting Obsidian seems to fix it and makes my dataview queries come back, but it’s still a non-solution since I need dataviewjs as well :confused: is this expected behavior? Am I supposed to not use both dataview and dataviewjs?

Hi!
Unfortunately not. I just got rid of that query, since it was low priority and I could’nt allocate enough time to solve it.