Error with importing and syntax errors

I was reading through Visualize a data frame with Observable, in Jupyter, and I noticed an error while using Safari. Specifically, it seems that the BigInt reference in JavaScript for Python Programmers, from which compareCode is imported, is causing the entire import to fail, which is not how I thought Observable worked. It also seems like the runtime isn’t expecting this because the error message is TypeError: compareCode is not a function. (In 'compareCode(topLeft, topRight, '', '')', 'compareCode' is undefined) instead of the expected RuntimeError: compareCode is not defined error that usually appears when a cell has a syntax error.

Thanks for pointing this out, I’ve fixed this notebook for now.

Although it doesn’t seem like expected behavior for notebooks that use browser features not supported to not be able to be imported, this notebook contains a BigInt literal like 123n, so just parsing the module is making this fail in Safari.

1 Like