erikbrinkman/d3-dag

"RuntimeError: invalid module" in examples hosted on Observable

oliviercailloux opened this issue · 6 comments

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.

Might be related to issue #66?

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!

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.

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?

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

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