erikbrinkman / d3-dag

Layout algorithms for visualizing directed acyclic graphs
https://erikbrinkman.github.io/d3-dag/
MIT License
1.45k stars 87 forks source link

"RuntimeError: invalid module" in examples hosted on Observable #73

Closed oliviercailloux closed 2 years ago

oliviercailloux commented 2 years ago

The README links to several examples hosted on Observable, such as Observable with Sugiyama Layout. They all fail to display the intended content, instead showing, for example, d3 = RuntimeError: invalid module.

oliviercailloux commented 2 years ago

Might be related to issue #66?

erikbrinkman commented 2 years ago

I'm having trouble reproducing that error. When I load the link above, it works as intended. Is there something wrong with observable, or can you do anything else to help me reproduce?

Thanks for submitting this, I do obviously want the examples to work!

oliviercailloux commented 2 years ago

I can see the examples on that same computer with Chromium, and on my phone. They only fail with Firefox (my version, from Debian bullseye, is 78.15.0esr 64 bits).

Interestingly, Firefox’s debugger shows: “Uncaught SyntaxError: private fields are not currently supported” from d3-dag.iife.min.js:15:10352, I suppose this is the reason.

erikbrinkman commented 2 years ago

Ah, it seems like it's actually related to #65. I assumed that at least among browsers private member support was standardized, but it seems like firefox only added it in version 90, and it makes sense that debian would would be a bit behind.

I've updated those references to use 0.8.2 which removed some advanced es syntax. Do they work now?

oliviercailloux commented 2 years ago

Great. They do work now. Just curious, aren’t tools like Babel able to work around such compatibility issues?

erikbrinkman commented 2 years ago

Yeah, but I dislike complicated build chains. As a result, I haven't looked too hard about polyfilling down to earlier versions of javascript.