NS_ERROR_FAILURE errors
See original GitHub issueHello there,
I keep encountering NS_ERROR_FAILURE errors when using d3-legend. Here’s an Observable notebook, which tries to recreate the Linear Scale Legend - Horizontal example.
I tried to recreate the example outside of an Observable notebook and encountered the same errors. Is it possible that there is an issue with the package?
Thanks in advance,
Iain
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (5 by maintainers)
Top Results From Across the Web
VirtualBox & NS_ERROR_FAILURE error - Dedoimedo
Tutorial showing how to resolve the issue of virtual machines not starting at all in VirtualBox, reflected in a generic NS_ERROR_FAILURE ...
Read more >VirtualBox error NS_ERROR_FAILURE (0x80004005) on ...
Solution for VirtualBox error NS_ERROR_FAILURE (0x80004005) on macOS which won't allow to launch the virtual machine after updating macOS.
Read more >VirtualBox NS_ERROR_FAILURE (0x80004005) macOS
This error seems to appear with VirtualBox installs on versions of macOS 10.13. To fix this issue, you have to uninstall VirtualBox (use...
Read more >Virtualbox does not run: NS_ERROR_FAILURE - Ask Ubuntu
There seems to be nothing wrong with your Virtual Box settings. However the error you see may be related to a previous fail...
Read more >NS_ERROR_FAILURE (0x80004005) in Windows 10 VM ...
I am getting an error NS_ERROR_FAILURE (0x80004005) in a Windows 10 virtual machine when saving, i.e. not closing down Windows, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Okay, pretty simple fix:
https://beta.observablehq.com/@mbostock/d3-legend
The issue is that d3-svg-legend depends on the SVG node being added to the DOM before you call it, and in Observable, things aren’t added to the DOM until the cell yields or returns. Specifically, you’re using element.getBBox on the text and shape elements generated by the legend, but since the SVG node hasn’t yet been added to the document, the bounding boxes can’t be computed—they are dependent on the styles that the SVG element will inherit, which isn’t known until the SVG element is added to the body.
Probably want you want to do is to have d3-svg-legend through an error if the element that you apply it to isn’t in the DOM. That would be something like this…
Problem solved now. I have to draw chart before displaying on page.
Regards jTzipi