Skip to content

[VSCode] Unable to find widget '@finos/perspective-jupyterlab' #3042

@steovd

Description

@steovd

Bug Report

PerspectiveWidget doesn't work in VSCode because the Jupyter extension cannot find widget frontend scripts in @finos/perspective-jupyterlab.

Steps to Reproduce:

  1. Install Jupyter and Python VSCode extensions.
  2. Open a notebook, select a kernel that has perspective-python installed.
  3. Try to display a PerspectiveWidget instance.
    import polars as pl
    from perspective.widget import PerspectiveWidget
    display(PerspectiveWidget(pl.DataFrame({"x": range(5), "y": range(5)})))

Expected Result:

The widget shows and works.

Actual Result:

  • In the cell's output, instead of the widget, a JS error is displayed, saying that the widget class could not be found. I'm paraphrasing because the error message shown was truncated and I didn't bother digging it up from logs as the cause seems clear (explained below).

  • VSCode displays this popup:

    Unable to find widget '@finos/perspective-jupyterlab' version '~3.6.1' from configured widget sources ["jsdelivr.com","unpkg.com"]. Expected behavior may be affected. Click here for more information.

  • In the Output view (View > Output), Jupyter logs contain:

    12:39:49.139 [error] Widget Error: Failed to access CDN https://unpkg.com/ after 0 attempt(s), TypeError: Failed to fetch
    12:39:55.220 [error] Widget Script @finos/perspective-jupyterlab#~3.6.1 was not found on on any cdn
    12:39:55.220 [warn] Widget Script Source not found for @finos/perspective-jupyterlab@~3.6.1 from cdn
    12:39:55.221 [warn] Widget Script Source not found for @finos/perspective-jupyterlab@~3.6.1 from local
    12:39:55.221 [error] Script source for Widget @finos/perspective-jupyterlab@~3.6.1 not found in cdn, local
    12:39:55.240 [error] Widget load failure {} [ 'jsdelivr.com', 'unpkg.com' ] {
      classNa<username>: 'PerspectiveModel',
      moduleNa<username>: '@finos/perspective-jupyterlab',
      moduleVersion: '~3.6.1',
      isOnline: true,
      ti<username>dout: false,
      error: '{}'
    }
    

Environment:

  • Arch Linux
  • VSCodium (1.102.14746)
  • CPython 3.12.8

Additional Context:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions