fix(jupyterlab): update @jupyter-widgets/base constraint for ipywidgets 8.x#3111
Open
rsp2k wants to merge 1 commit intoperspective-dev:masterfrom
Open
fix(jupyterlab): update @jupyter-widgets/base constraint for ipywidgets 8.x#3111rsp2k wants to merge 1 commit intoperspective-dev:masterfrom
rsp2k wants to merge 1 commit intoperspective-dev:masterfrom
Conversation
…ts 8.x The JupyterLab extension fails to load with ipywidgets 8.x because the version constraint ">2 <5" rejects @jupyter-widgets/base 6.x which is provided by ipywidgets 8.x (the current stable release). Error in browser console: Unsatisfied version 6.0.11 from @jupyter-widgets/jupyterlab-manager of shared singleton module @jupyter-widgets/base (required >=2 not(^2) <5) This causes widgets to fail with: TypeError: undefined is not iterable Update the constraint from ">2 <5" to ">2 <7" to support both ipywidgets 7.x (@jupyter-widgets/base 4.x) and ipywidgets 8.x (@jupyter-widgets/base 6.x). Fixes compatibility with: - JupyterLab 4.x - ipywidgets 8.x (current stable) Signed-off-by: Ryan Malloy <ryan@supported.systems>
926b655 to
b8f4051
Compare
texodus
requested changes
Jan 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
So I was trying to get Perspective running in JupyterLab 4 and kept hitting this wall where the widget just... wouldn't load. Dug into the browser console and found the culprit - there's a version constraint on
@jupyter-widgets/basethat's rejecting version 6.x.The thing is, ipywidgets 8.x has been the stable release since October 2022. It ships
@jupyter-widgets/base6.0.11, but the current constraint in the jupyterlab package is">2 <5"- which obviously doesn't include 6.x.Two-line fix: bump the upper bound from
<5to<7.Changes
packages/jupyterlab/package.json:@jupyter-widgets/basefrom">2 <5"to">2 <7"pnpm-workspace.yaml: same change in the catalog entryDid it work?
Ran through the semver math to make sure I wasn't breaking existing setups:
6.0.11(ipywidgets 8.x) satisfies">2 <7"- yep4.1.7(ipywidgets 7.x) still satisfies">2 <7"- still worksThen spun up a fresh Docker container (node:20 devcontainer) to validate the dependency resolution in isolation:
pnpm installresolved all 1805 packages with no version conflictsSo both ipywidgets 7.x and 8.x environments should be happy now.
Related issues
This is adjacent to #2060 (Support ipywidgets 8) and #2307 (Support JupyterLab 4) - those got closed but this specific version constraint issue slipped through.
Test plan
pnpm installsucceeds (1805 packages)