Skip to content

Did the recent upgrade of ipywidgets (7.7.1->8.0.1) change the CDN-service for custom widgets? #3573

Closed
@audunsh

Description

@audunsh

Thanks 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/[email protected]/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)]'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Custom WidgetIssues related to using ipywidgets as a framework for custom widgetsquestion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions