Description
Here’s the scenario: I’m in JupyterLab. I create a notebook that displays a widget. I save the notebook, close it, shut down the kernel.
Sometime later I come back and reopen the notebook. The widget reconstitutes itself from the model and displays (albeit with the “disconnected from kernel” icon). So far everything is good. But here’s where the problem starts…
I save the notebook again, close it and shut the kernel down. I don’t even need to change anything. The next time I open it up, the widget tries to reconstitute itself from the model, but instead I get an “Error displaying widget: model not found” message.
Sure enough, I open up the ipynb in a json editor and can see that the cell has an application/vnd.jupyter.widget-view+json output with a model_id, but no corresponding model with that id is to be found in the metadata.
Reproduce
Here is a binder link that demonstrates the issue.
- Run the two cells below. Go ahead and make sure that the notebook is trusted and that "Save Widget State Automatically" is checked in the Settings menu.
- Save this notebook, close it and shut down the kernel.
- Open this notebook a second time. Don't change a thing. Just make sure that the Text widget renders from the model appropriately. Great!
- Save the notebook again. Close it and shut down the kernel.
- Open the notebook a third time. Watch as the cell with the widget displays: "Error displaying widget: model not found".
Expected behavior
Since the notebook was not edited, I would expect the widget model to still be in the metadata and the widget to still be able to reconstitute itself from the model.
Context
- ipywidgets version: 7.6.3
- Operating System and version: Linux & Mac
- Browser and version: Firefox & Chrome
- JupyterLab: 3.1.1
Description
Here’s the scenario: I’m in JupyterLab. I create a notebook that displays a widget. I save the notebook, close it, shut down the kernel.
Sometime later I come back and reopen the notebook. The widget reconstitutes itself from the model and displays (albeit with the “disconnected from kernel” icon). So far everything is good. But here’s where the problem starts…
I save the notebook again, close it and shut the kernel down. I don’t even need to change anything. The next time I open it up, the widget tries to reconstitute itself from the model, but instead I get an “Error displaying widget: model not found” message.
Sure enough, I open up the ipynb in a json editor and can see that the cell has an application/vnd.jupyter.widget-view+json output with a model_id, but no corresponding model with that id is to be found in the metadata.
Reproduce
Here is a binder link that demonstrates the issue.
Expected behavior
Since the notebook was not edited, I would expect the widget model to still be in the metadata and the widget to still be able to reconstitute itself from the model.
Context