Did the recent upgrade of ipywidgets (7.7.1->8.0.1) change the CDN-service for custom widgets?
See original GitHub issueThanks you for the innovative and very useful work you are doing with the ipywidgets-framework.
I’m prototyping a piece of visualization software built from the widget-cookiecutter and threejs. I’ve been testing mainly in notebooks and html-embedding.
Recently, I updated ipywidgets from 7.7.1 to 8.0.1, which seems to have broken the html-embed option. On 8.0.1 it still runs nicely in the Notebook, but when either doing “embed_minimal_html”, nbconvert to html, or (from the menu in the Notebook-environment) “embed widget state”, no view is shown in the resulting html.
I’m fairly new to Javascript, so I’m still struggling to debug properly, but the console (on Chrome, 104.0.5112.101 ) reports that it is “Falling back to https://cdn.jsdelivr.net/npm/” to fetch my embedded model. It then complains that “embed-amd.js:16 TypeError: o._deserialize_state is not a function at xc._make_model (embed-amd.js:16:581882)”. I cannot find any other reference to this error-message using google or browsing the documentation.
However, when downgrading ipywidgets to 7.7.1, my custom widgets works as intended. From my console, I can then read that it is "falling back to https://unpkg.com/ " for my embedded model, and it shows up on screen.
In my webpack.config.js-file, it explicitly says
entry: './lib/embed.js',
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'amd',
publicPath: 'https://unpkg.com/evince@' + version + '/dist/'
},
which I understand to be the CDN-service from which to request the model.
My question is then, has there been made some changes recently which could affect this behaviour (changing from unpkg.com to cdn.jsdelivr.net), or is there something else I’m missing here?
Best regards, Audun
My setup:
{'commit_hash': '4396dd620',
'commit_source': 'installation',
'default_encoding': 'utf-8',
'ipython_path': '/usr/local/lib/python3.10/site-packages/IPython',
'ipython_version': '8.4.0',
'os_name': 'posix',
'platform': 'macOS-12.3.1-x86_64-i386-64bit',
'sys_executable': '/usr/local/opt/python@3.10/bin/python3.10',
'sys_platform': 'darwin',
'sys_version': '3.10.6 (main, Aug 11 2022, 13:49:25) [Clang 13.1.6 '
'(clang-1316.0.21.2.5)]'}
Issue Analytics
- State:
- Created a year ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
Thanks for resolving this issue efficiently. I can confirm that it works as intended now (Notebooks, embedding with export_minimal_html, nbconvert, “embed widget state” and jupyter book). Again, keep up the excellent work!
Ah, you’re right! https://github.com/jupyter-widgets/widget-cookiecutter/blob/6134771c6f2d7c275b186ff0cc00839be8d067b6/{{cookiecutter.github_project_name}}/js/lib/example.js does indeed have the old way of doing it! Thanks for pointing this out.
I’ll make a PR to update that part of the cookiecutter.
I’d still suggest using the js cookiecutter. The ts cookiecutter is more out of date than the js cookiecutter with respect to ipywidgets 8.