Ipywidgets: Error rendering Jupyter widget. Widget not found

Created on 15 Sep 2017  路  10Comments  路  Source: jupyter-widgets/ipywidgets

As discussed in https://github.com/jupyter-widgets/ipywidgets/issues/1667#issuecomment-329029508, this message conveys the idea of something is going wrong. It is my understanding that Jupyter was trying to say "the state of this widget was not found" or maybe "the instance of the widget was not found", but not the _widget_ itself. Perhaps, the simplest solution would be to change the message to be clearer. It is more like a warning than an error.

resolved-locked

Most helpful comment

@jonathansp - I put a variant of the above in #1716. If you have any suggestions, please let me know. Thanks again for pointing out that this error message could be better.

All 10 comments

Thanks for opening a new issue to track this. In one sense, the message is correct - the widget is not found on the javascript side. I can see how the message is too confusing/technical to make sense of, though, and doesn't give good suggestions about how to recover. How about:

A Jupyter widget could not be displayed because the widget state could not be found. This could happen if the kernel the widget was created in is no longer available, or if the widget state was not saved in the notebook. You may be able to create the widget by running the appropriate cells.

@jonathansp - I put a variant of the above in #1716. If you have any suggestions, please let me know. Thanks again for pointing out that this error message could be better.

Is there a way to prevent this error message from appearing? I'm trying to create a transparent user experience, but if the kernel is shutdown and the notebook reopened, every widget that was open dumps this message onto the screen. If not, is there a way to clear every cell's output when the kernel starts/restarts through the custom.js file? Thanks!

Edit: One way to clear every cell's output on notebook start is to put the line Jupyter.notebook.clear_all_output(); in .jupyter/custom/custom.js, but this isn't an entirely appropriate solution. The user could have output (user-created widgets, other elements of the saved state) that they do want displayed when a notebook is loaded, and clearing all outputs on load would be inappropriate.

What version of ipywidgets are you using?

ipywidgets.__version__ is 7.2.1.

Anyone ever find a solution to silencing these warnings?

What would you rather have happen? The error is trying to help the user know why they are not seeing a widget like they would expect.

I would like a command that I could put in the end of my cell that would silence the warning for that cell.

Given this issue has been closed for over 2 years, can we make a new issue if you'd like to discuss this further? Can we start with an explanation of what the current status is (e.g., explain what happens with a current ipywidgets install in your situation)?

Thanks!

ERROR in ./src/main.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Cannot find module '@babel/plugin-proposal-class-properties' from 'C:\Users\mohanapriya.sb\manifold-master'
at Function.resolveSync [as sync] (C:\Users\mohanapriya.sb\manifold-master\examples\manifold\node_modules\resolve\lib\sync.js:81:15)
at resolveStandardizedName (C:\Users\mohanapriya.sb\manifold-master\examples\manifold\node_modules\@babel\core\lib\config\files\plugins.js:101:31)
at resolvePlugin (C:\Users\mohanapriya.sb\manifold-master\examples\manifold\node_modules\@babel\core\lib\config\files\plugins.js:54:10)
at loadPlugin (C:\Users\mohanapriya.sb\manifold-master\examples\manifold\node_modules\@babel\core\lib\config\files\plugins.js:62:20)
at createDescriptor (C:\Users\mohanapriya.sb\manifold-master\examples\manifold\node_modules\@babel\core\lib\config\config-descriptors.js:154:9)
at items.map (C:\Users\mohanapriya.sb\manifold-master\examples\manifold\node_modules\@babel\core\lib\config\config-descriptors.js:109:50)
at Array.map ()
at createDescriptors (C:\Users\mohanapriya.sb\manifold-master\examples\manifold\node_modules\@babel\core\lib\config\config-descriptors.js:109:29)
at createPluginDescriptors (C:\Users\mohanapriya.sb\manifold-master\examples\manifold\node_modules\@babel\core\lib\config\config-descriptors.js:105:10)
at plugins (C:\Users\mohanapriya.sb\manifold-master\examples\manifold\node_modules\@babel\core\lib\config\config-descriptors.js:40:19

"devDependencies": {
"source-map-loader": "^0.2.4",
"webpack": "^4.27.1",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.10"
},
"scripts": {
"start": "webpack-dev-server --progress --hot --open",
"start-local": "webpack-dev-server --env.local --progress --hot --open"
},
"dependencies": {
"@babel/core": "^7.8.4",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/preset-env": "^7.8.4",
"antd": "^3.23.2",
"babel-loader": "^8.0.6",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.9.0",
"react-container-dimensions": "^1.4.1",
"react-dom": "^16.8.6",
"react-redux": "^7.1.1",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-router-redux": "^4.0.8"
},
"pluggin":
[
"@babel/plugin-proposal-class-properties",{"loose":true}
]

Was this page helpful?
0 / 5 - 0 ratings