observablehq/runtime

Cells that depend on views or mutables cannot be cleanly imported.

mbostock opened this issue · 1 comments

Given document A:

mutable foo = "foo"
mutable_foo_reference = mutable foo

And document B:

import {mutable_foo_reference} from "bc24298cd70a4c0a"
mutable_foo_reference

We expect the imported mutable_foo_reference in document B to equal "foo". However, we instead see a RuntimeError: mutable_foo_reference could not be resolved.

This can be avoided by explicitly importing either mutable foo or foo, but this additional import should not be necessary.

I spent some time trying to chase this down yesterday evening, and added a runtime test that I thought should have demonstrated the issue ... but it passes:

9019bfe

Something is causing the evaluation of an indirectly imported mutable reference to fail to attempt to evaluate.