question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

model_id null prevents widget rendering in nbviewer

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
SylvainCorlaycommented, Mar 29, 2017

It is nice that it worked out eventually. Sorry for the late reply.

0reactions
cornhundredcommented, Mar 29, 2017

The problem was that my class, Network, which the widget was inheriting from

class clustergrammer_widget(widgets.DOMWidget, Network):

was 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 a model_id of null in 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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found