Skip to content

ENH: Give a clearer error for widget js. #1674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ssanderson
Copy link

Adds a new 'text/html' entry in the mimebundle for widgets, which points
users to the installation instructions in the widgets docs.

Adds a new 'text/html' entry in the mimebundle for widgets, which points
users to the installation instructions in the widgets docs.
@ssanderson
Copy link
Author

cc @jasongrout

@pbugnion
Copy link
Member

Nice! That's much clearer.

@jasongrout
Copy link
Member

+1. @pbugnion, can you review and merge if it looks good to you?

<p>Failed to display Jupyter Widget of type <code>{widget_type}</code>.</p>
<p>
If you're reading this message in Jupyter Notebook or JupyterLab, it probably means that
the widgets Javascript library is either not installed or not enabled. See
Copy link
Member

@pbugnion pbugnion Aug 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be JavaScript, rather than Javascript? That's how Wikipedia spells it.

<p>
If you're reading this message in Jupyter Notebook or JupyterLab, it probably means that
the widgets Javascript library is either not installed or not enabled. See
the <a href=http://ipywidgets.readthedocs.io/en/latest/user_install.html>Jupyter Widgets Documentation</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use https rather than http for the protocol of the URL.

@pbugnion
Copy link
Member

pbugnion commented Aug 27, 2017

If you reopen a notebook that contains lots of widgets, or contains some widgets that take a long time to render, this message will be displayed until the widgets have finished rendering. The user might think their installation is broken, whereas they actually just need to wait.

Maybe we can change the copy to include this? e.g.

If you're reading this message in Jupyter Notebook or JupyterLab, your widget is either still loading, or the widgets Javascript library is either not installed or not enabled.

@ssanderson
Copy link
Author

If you reopen a notebook that contains lots of widgets, or contains some widgets that take a long time to render, this message will be displayed until the widgets have finished rendering. The user might think their installation is broken, whereas they actually just need to wait.

Interesting. Is there any way to distinguish between these cases on the frontend side and show a different representation (e.g. a loading spinner) when the javascript is still loading? Ideally I'd want to avoid giving the user too many different possible cases to think about if we can.

@ssanderson
Copy link
Author

@pbugnion updated with your feedback:

image

I still think it'd be nice to try to distinguish the cases mentioned in #1674 (comment), but that's probably a larger piece of work and shouldn't block this improvement IMO.

@pbugnion
Copy link
Member

pbugnion commented Aug 29, 2017

Is there any way to distinguish between these cases on the frontend side and show a different representation (e.g. a loading spinner) when the javascript is still loading? Ideally I'd want to avoid giving the user too many different possible cases to think about if we can.

I'll open a new issue to discuss showing a loading icon while the widget manager is rebuilding its state after loading.

that's probably a larger piece of work and shouldn't block this improvement IMO

I definitely agree. Thanks for this!

@pbugnion pbugnion merged commit 1bc4a67 into jupyter-widgets:master Aug 29, 2017
@ssanderson ssanderson deleted the clearer-no-javascript-error branch August 29, 2017 13:18
@jasongrout jasongrout added this to the 7.0.1 milestone Nov 17, 2017
jasongrout added a commit to jasongrout/ipywidgets that referenced this pull request Mar 20, 2018
This reverts jupyter-widgets#1674, since we discovered some problems with the classic notebook and html outputs.

Fixes jupyter-widgets#1777
Fixes jupyter-widgets#1951
@github-actions github-actions bot added the resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Feb 9, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants