question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dv.list returns a Promise and errors in log

See original GitHub issue

What happened?

Having this:

`$=dv.list([1,2,3])`

outputs <Promise> and the log shows

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'addChild')
    at DataviewApi.list (plugin:dataview:20220:19)
    at DataviewInlineApi.list (plugin:dataview:19638:25)
    at eval (eval at <anonymous> (plugin:dataview:1:1), <anonymous>:1:38)
    at DataviewInlineApi.eval (plugin:dataview:20560:44)
    at evalInContext (plugin:dataview:20561:35)
    at enter (plugin:dataview:20555:42)
    at e.iterate (app.js:1:293053)
    at ei.iterate (app.js:1:1541428)
    at inlineRender (plugin:dataview:20491:43)
    at view.ViewPlugin.fromClass.decorations.update (plugin:dataview:20603:42)

DQL

No response

JS

$=dv.list([1,2,3])

Dataview Version

0.5.46

Obsidian Version

0.15.9

OS

Windows

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
blacksmithgucommented, Oct 11, 2022

Live preview doesn’t handle dv.list and other Dataview directives inside inline fields currently; you should use a full codeblock instead:

dv.list(...);
0reactions
stecydubecommented, Oct 10, 2022

As a picture showing the different outcome

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error handling with promises - The Modern JavaScript Tutorial
Promise chains are great at error handling. When a promise rejects, the control jumps to the closest rejection handler.
Read more >
Handling errors in Promise.all - Stack Overflow
This utility function returns an object with results and errors . The idea is that all Promises you pass to executeAllPromises will be...
Read more >
Promise Error Handling - JavaScript Tutorial
In this tutorial, you will learn about promise error handling that shows you how to handle error in promises.
Read more >
Fetch returns promise. However, no error will be thrown if the ...
The first promise is a fetch request for a list of Github repositories. querySelector It returns a promise that resolves with a String....
Read more >
Promise.all() - JavaScript - MDN Web Docs
This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found