bokeh/ipywidgets_bokeh

Wrong widget protocol version thrown when using an ipywidget in a callback

getehen opened this issue · 1 comments

Hi,

I'm using panel and ipywidgets together, and whenever I do something related to ipywidgets from a callback function triggered by a panel widget, I've got this error : Wrong widget protocol version: received protocol version '', but was expecting major version '2' in the browser console

Expected behavior : No error

Simple program to reproduce :

import panel, ipywidgets

ipywidget = ipywidgets.Label(value="IPYWIDGET")
button = panel.widgets.Button(name='Actualiser')
test_box = ipywidgets.Box([])

def callback(value):
    something_happening_with_ipywidget = ipywidgets.Box([])

button.param.watch(callback, ['value'], onlychanged=True)

panel.Row(ipywidget, button).servable()

The error triggers only if I click the button, so it's not ipywidgets.Box([]) that's the cause of the error

I'm posting this here because it's thrown by ipywidgets_bokeh

PS : if I do not display any ipywidgets widget or if I don't do anything ipywidgets related in the callback, the error isn't thrown

I have similar problem with panel and ipyleaflet, will create new issue.