We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Dataview (for inline JS query 'dv.list(app.workspace.getLastOpenFiles().map(function(x){return(dv.page(x).file)}))'): TypeError: Cannot read properties of undefined (reading 'file')
No response
$=dv.list(app.workspace.getLastOpenFiles().map(function(x){return(dv.page(x).file)})) The request has worked once, but do not work anymore ... For info the following request is working well `$=dv.page(app.workspace.getLastOpenFiles()[0]).file` resulting in path: 001-Home/lastViewed.md, folder: 001-Home, name: lastViewed, link: lastViewed, outlinks: <empty list>, inlinks: home, etags: <empty list>, tags: <empty list>, aliases: <empty list>, lists: <empty list>, tasks: <empty list>, ctime: 5:25 PM - avril 09, 2024, cday: avril 09, 2024, mtime: 6:53 PM - avril 09, 2024, mday: avril 09, 2024, size: 541, starred: false, frontmatter: <empty object>, ext: md
0.5.66
1.5.12
MacOS
The text was updated successfully, but these errors were encountered:
you are accessing the file property on an undefined object. this is not a dataview issue.
try this:
`$=dv.list(app.workspace.getLastOpenFiles().map(path => typeof dv.page(path) + " - " + path))`
as you can see in my case, non-notes are not pages so obviously, dv.page will not return a page in said case.
dv.page
what you CAN do, is this:
`$=dv.list(app.workspace.getLastOpenFiles().map(x=>dv.page(x)).filter(x=>x).map(x=>x.file))`
Sorry, something went wrong.
Thx so much for the answer !!! Testing the type of solved my issue
No branches or pull requests
What happened?
Dataview (for inline JS query 'dv.list(app.workspace.getLastOpenFiles().map(function(x){return(dv.page(x).file)}))'): TypeError: Cannot read properties of undefined (reading 'file')
DQL
No response
JS
Dataview Version
0.5.66
Obsidian Version
1.5.12
OS
MacOS
The text was updated successfully, but these errors were encountered: