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.

Cannot read property 'graphvizVersion' of undefined

See original GitHub issue

Hello! I contribute to a VS Code extension that uses d3-graphviz for one of its features. While trying to upgrade the dependencies, including d3-graphviz 4.0.0 to 4.1.0, I noticed that the feature broke with the error in the issue title.

I don’t really have experience with the Node ecosystem, so it’s quite likely that I messed something up. Perhaps you might have an idea?

See https://github.com/rust-analyzer/rust-analyzer/pull/11821 for more details. The relevant code is https://github.com/rust-analyzer/rust-analyzer/blob/deb5c14/editors/code/src/commands.ts#L485-L541.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
magjaccommented, Apr 9, 2022

This issue is fixed in version 4.1.1.

1reaction
magjaccommented, Mar 29, 2022

I can now confirm that this is a bug in d3-graphviz. It seems that the new graphvizVersion() does not work when using a web worker. Here’s a workaround:

diff --git a/examples/basic-grow-entering-edges.html b/examples/basic-grow-entering-edges.html
index b909a60..914967c 100644
--- a/examples/basic-grow-entering-edges.html
+++ b/examples/basic-grow-entering-edges.html
@@ -2,7 +2,7 @@
 <meta charset="utf-8">
 <body>
 <script src="../node_modules/d3/dist/d3.js"></script>
-<script src="../node_modules/@hpcc-js/wasm/dist/index.js" type="javascript/worker"></script>
+<script src="../node_modules/@hpcc-js/wasm/dist/index.js"></script>
 <script src="../build/d3-graphviz.js"></script>
 <div id="graph" style="text-align: center;"></div>
 <script>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Using d3-graphviz results in can't read property '__graphviz__ ...
UPDATE: I found the answer. The error is being thrown because the dom object (div) is not rendered yet when rendering the diagram....
Read more >
Uncaught TypeError: Cannot read property 'x' of undefined ...
Please provide a complete test case that illustrates the problem. Also please specify which Chrome version you are using, latest is perishable.
Read more >
"global is undefined" when using viz.js through d3-graphviz
The error I'm getting on your notebook is a bit different than what you have written down: Cannot read property 'Int8Array' of undefined....
Read more >
d3-graphviz - npm
d3-graphviz. Renders SVG from graphs described in the DOT language using the @hpcc-js/wasm port of Graphviz and does animated transitions between graphs.
Read more >
Cannot read property 'name' of undefined, at Array.forEach
TypeError : Cannot read property 'name' of undefined, at Array.forEach. When I press the button to display the task pane, I am seeing...
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