Debug question in a notebook

I am trying to use GitHub - EE2dev/sequence-explorer: Exploring sequential data with a sankey diagram in a notebook Sankey Seq / ee2dev | Observable and get an error:

TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))

Can someone point me into a direction how to debug in this case, e.g. find out where to look into?
(I first thought the reason is the version of d3 it expects, but that doesn’t seem to be the case.

It’s caused by your library’s call to d3.map() without passing any arguments. You can debug errors like this one by checking “Pause on caught exceptions” in the devtools and then rerunning the cell. Note however that there may be a lot of intermediate caught errors that you have to skip by repeatedly clicking the play button in the debugger.

Looking at the source of your library’s build we can see that it calls require() without any version constraints, and without also bundling the dependencies. You would have to use require.alias and specify versions for all the referenced libraries. To give an incomplete example:

sequenceExplorer = require.alias({d3: "d3@4", "d3-array": "d3-array@1.2.1"})("https://ee2dev.github.io/libs/sequence-explorer.v20.js")
1 Like

Thanks so much! That was super helpful. I was suspecting the breaking changes come from the old d3 version and I could follow your pattern and got it to work: https://observablehq.com/@ee2dev/sequence-explorer

Reminds me that I should upgrade the original repo to work with the current d3 version. I think this great notebook D3 6.0 migration guide / D3 | Observable might help me, since I expect most modifications coming with d3v6.
Thanks! :heart_eyes: