model_id null prevents widget rendering in nbviewer
See original GitHub issueI am modifying my widget’s API (our group is building a custom widget that used the cookiecutter template), which works locally but does not work on nbviewer and I think the problem is that model_id is being set to null. I also could not find documentation on model_id in the docs.
Here is an nbviewer link to my notebook with two widgets made using the two different methods: notebook link. Again, only the first widget renders on nbviewer, but both render locally.
Nbviewer console output tells me that embed-webpack.js is not able to validate widgetViewObject (line 96). I ran a debugger and looked at widgetViewObject, which shows
// the first widget renders and has a model_id
widgetViewObject
Object {model_id: "6bc8e3a09d47486e808ca929bf1c910a"}
// the second widget does not render has has null model_id
widgetViewObject
Object {model_id: null}
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Embedding Jupyter Widgets in Other Contexts than the ...
Rendering Interactive Widgets on nbviewer¶. If your notebook was saved with the special “Save Notebook Widget State” action in the Widgets menu, interactive ......
Read more >Jupyter widget does not appear in notebook - Stack Overflow
Failed to display Jupyter Widget of type Button. If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean...
Read more >Widget not rendering on JupyterLab examples
Widget not rendering on JupyterLab when running main.py on examples/app and examples/notebook. Go to root folder after cloning GitHub ...
Read more >Interactive Controls in Jupyter Notebooks | by Will Koehrsen
IPython widgets, unfortunately, do not render on GitHub or nbviewer but you can still access the notebook and run locally.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

It is nice that it worked out eventually. Sorry for the late reply.
The problem was that my class,
Network, which the widget was inheriting fromwas re-initializing itself when I loaded data and this was causing the error with
model_id. I turned off this re-initialization and I am no longer getting amodel_idofnullin the notebook. I have to better understand why the initialization was causing this problem, but for now it is fixed (see notebook with old and new widget APIs working: notebook link).