Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

binder example not working; has javascript error. #1144

Unanswered
rafaellichen asked this question in Problem
Discussion options

what should i do? same issue happens on my local machine; i cannot upgrade to reactpy, still using idom_jupyter 0.7.7 and idom 0.42.0 at this point.

image
Failed to create view for 'AnyView' from module 'anywidget' with model 'AnyModel' from module 'anywidget'
TypeError: this.view.on is not a function
 at new JupyterReactPyClient (blob:https://notebooks.gesis.org/04201439-4de8-462a-8c7b-7decb5df5f08:1423:19)
 at Module.render (blob:https://notebooks.gesis.org/04201439-4de8-462a-8c7b-7decb5df5f08:1395:14)
 at AnyView.render (https://notebooks.gesis.org/binder/jupyter/user/reactive-python-reactpy-jupyter-k8xp25gq/lab/extensions/anywidget/static/326.cc621ff41abd2006f96d.js?v=cc621ff41abd2006f96d:1:2548)
 at async https://notebooks.gesis.org/binder/jupyter/user/reactive-python-reactpy-jupyter-k8xp25gq/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.1a6d6a3a0542a41bec5a.js?v=1a6d6a3a0542a41bec5a:1:2951
 at async w.renderModel (https://notebooks.gesis.org/binder/jupyter/user/reactive-python-reactpy-jupyter-k8xp25gq/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.402424ef4079078b2e0e.js?v=402424ef4079078b2e0e:1:72264)
You must be logged in to vote

Replies: 2 comments 1 reply

Comment options

Came here to post this, I have the same issue. Is there a solution/workaround? Seems like ReactPy and Ipywidgets are not playing nice anymore.

You must be logged in to vote
0 replies
Comment options

Upgrading anywidget may fix this

You must be logged in to vote
1 reply
Comment options

Hi there, I tried the most recent anywidget 0.7.1 and downgraded to 0.7.0 - same result. However, converting any example to using "idom" does work.

for example:

from reactpy import component, html, run
@component
def Photo():
 return html.img(
 {
 "src": "https://picsum.photos/id/237/500/300",
 "style": {"width": "50%"},
 "alt": "Puppy",
 }
 )
Photo()

Fails with the Javascript error.

[Open Browser Console for more detailed log - Double click to close this message]
Failed to create view for 'AnyView' from module 'anywidget' with model 'AnyModel' from module 'anywidget'
TypeError: this.view.on is not a function
 at new JupyterReactPyClient (blob:http://localhost:8888/dc1993ee-70cc-4013-b9ba-49385291829a:1423:19)
 at Module.render (blob:http://localhost:8888/dc1993ee-70cc-4013-b9ba-49385291829a:1395:14)
 at AnyView.render (http://localhost:8888/nbextensions/anywidget/index.js:172:34)
 at async http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js:2:775044

However --

import idom
@idom.component
def Photo():
 return idom.html.img(
 {
 "src": "https://picsum.photos/id/237/500/300",
 "style": {"width": "50%"},
 "alt": "Puppy",
 }
 )
Photo()

Puppy

Works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /