I’ve been running into an issue where
require'd modules intermittently throw a mysterious
Pe: invalid module error if I’ve imported Observable’s runtime library and embedded a notebook in another cell. The following notebook is my attempt to give a minimal example:
The two cells of interest are:
vega-lite(can be replaced with any other module of your choice, in my original case it was
loaded, which embeds an almost-blank notebook using
required Observable runtime and inspector libraries.
In my browser (Chrome, macOS), about ~2/3 of the time
loaded shows an error “
RuntimeError: md could not be resolved”. The other ~1/3 of the time the
req cell fails with
Pe: invalid module.
If I comment out
loaded never seems to get an error. If I comment out
req always seems to be fine. If I comment out the dependencies in
req to change the evaluation order then I can sometimes get no error in either of the cells.
(I also see this in Firefox when I use a polyfill for dynamic import, but I stripped that out to make the example simpler.)
Ultimately I’d like to be able to
require and embed notebooks without fear. I’d appreciate any pointers or advice on how to debug this sort of thing.