jupyter-widgets / ipywidgets

Interactive Widgets for the Jupyter Notebook

Home Page:https://ipywidgets.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Embed doesn't work anymore? (e.g: Syncing error: no comm channel defined)

hainm opened this issue · comments

Hi there,

I am trying to embed nglview-js-widgets 3.1.0 in my application but getting below error:
https://www.npmjs.com/package/nglview-js-widgets

image

You could try to download index.html.txt (-> index.html) and open it to see the error message
index.html.txt

If I change the nglview-js-widgets version from 3.1.0 to 3.0.8 in the index.html, thing just work.

3.1.0 version works fine in the notebook and lab.

Do you have idea how to resolve this? Thanks.

Another way to reproduce is

pip install nglview==3.1.0 # ipywidgets 8, notebook 7

And in notebook

# 1st cell
import nglview as nv
view = nv.demo()
view

# 2nd cell
nv.write_html("index.html", view)
!open index.html

Syncing error: no comm channel defined'

sync(method: string, model: WidgetModel, options: any = {}): any {
// the typing is to return `any` since the super.sync method returns a JqXHR, but we just return false if there is an error.
if (this.comm === undefined) {
throw 'Syncing error: no comm channel defined';
}

Seems like an issue with the NGL release instead: nglviewer/ngl#1014