🏠 back to Observable

Notebook hanging with Hypertext Literal

I seem to have gotten myself into a bit of a mess. I wanted to try Hypertext Literal with my notebook so I added the line to import it:

import {html, svg} from "@observablehq/htl"

This created some errors named “Invalid binding”.

I have a large app so I have divided it up into 10 different notebooks and import the “subnotebooks” into the main one. I added the Hypertext Literal import to the main notebook and got the “Invalid binding” errors and thought it was because the notebooks were using the old “html” and the main notebook was using the new “html”. So I added the Hypertext Literal import line to one of the subnotebooks that I import and suddenly all the notebook started hanging and I had to go into safe mode to edit them.

So I removed the Hypertext Literal import for the subnotebook and the main notebook but the hanging issue has persisted. I even went back to Mike Bostock’s Hypertext Literal notebook and it was hanging. Reloading it fixed this.

First I would like recover my notebooks so they can be used. They are there but if I exit safe mode they hang.

Second I would like to be able to use Hypertext Literal in my notebooks. Is it possible to use it in a structure like mine with multiple notebooks being imported.

I suspect that you have a background tab with Observable open that is still hung.

Browsers allocate one process per domain (so called “out-of-process iframes”), which means that if any notebook you visit goes into an infinite loop, all other notebooks will hang as well. The only way to fix it is to close all Observable notebook tabs, or equivalently restart your browser.

(We‘re considering using BroadcastChannel to fix this problem by rebooting all notebooks when a notebook hangs, but this happens rarely so we haven’t yet made it a priority.)

If you’re willing to message us privately a link to your notebook(s), or even better a minimal reproduction, I’d also love to understand why your notebook went into an infinite loop in the first place.

1 Like

(Replied privately, but to provide public closure: we found an infinite while loop that was causing the notebook to hang.)

1 Like