Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on open with inline dvjs in template #2335

Open
aprice opened this issue May 21, 2024 · 1 comment
Open

Error on open with inline dvjs in template #2335

aprice opened this issue May 21, 2024 · 1 comment
Labels
bug Something isn't working.

Comments

@aprice
Copy link

aprice commented May 21, 2024

What happened?

I have a daily note template that includes a dvjs inline query $= dv.pages('"Daily"').where(p => p.file.day && p.file.day < dv.current().file.day).sort(p => p.file.day, "desc").file.link.limit(1), based on the example query for getting a link to the previous daily note that exists. However, when I create a new daily note, I initially get an error TypeError: Cannot read properties of undefined (reading 'file').

I know sometimes glitches sort themselves out after a moment, after making any change to the file, or switching tabs and back, but this one doesn't; I have to call Dataview: Rebuild current view or close & reopen the file, and then it renders fine. Obviously the type error is a phantom as it resolves itself without any change to the query or the files it's querying.

Note that this is in Editing mode. I recently introduced this to my workflow, so I don't know if the error would have happened in older versions.

DQL

$= dv.pages('"Daily"').where(p => p.file.day && p.file.day < dv.current().file.day).sort(p => p.file.day, "desc").file.link.limit(1)

JS

No response

Dataview Version

0.5.66

Obsidian Version

1.5.12

OS

MacOS

@aprice aprice added the bug Something isn't working. label May 21, 2024
@aprice
Copy link
Author

aprice commented Jun 14, 2024

Confirmed the same issue persists in Obsidian 1.6.3 & DV 0.5.66.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

1 participant