Editing deadlock: "RuntimeError: myNonexistentVariable is not defined"

Occasionally I seem to end up in a deadlock when editing. I can’t really say what’s leading up to it, but it manifests as “RuntimeError: myNonexistentVariable is not defined” that persists when I change to the correct variable name. From Notebook dependencies / Magnus Jacobsson | Observable :

I’ve clicked play and tried shift-enter or editing another cell, but it doesn’t help. Changing the name to some other nonexistent variable updates the error message, but when changing back to the correct variable name the new error message persists:

Reloading the notebook solves the problem.

Seems very easy to reproduce now. Just edit https://beta.observablehq.com/@magjac/notebook-dependencies#topNotebook

This is not a bug per se, but the display is a little confusing. The important tiny detail to note is that, although the RuntimeError is still displayed, the left border has gone from red back to gray indicating that the cell is computing.

So, this is a syntax error:

And this is a cell that is computing (that previously errored):

The old error is still displayed because Observable continues to display the previous value of a cell until the new value resolves. And in this notebook, that value won’t resolve until you type in a notebook’s slug in the top input and click “Go”, so you could be waiting a while.

Thanks Mike. I didn’t realize that the error message was actually the cell value. If I had, maybe I could have figured it out myself.

You learn new stuff everyday :grinning:. That’s why I :heart: Observable!