ipywidgets icon indicating copy to clipboard operation
ipywidgets copied to clipboard

Make sure that all session contexts has unique IDs even if they don't have a kernel

Open Kontinuation opened this issue 10 months ago • 1 comments
trafficstars

Fixes https://github.com/jupyter-widgets/ipywidgets/issues/3970 by making sure that we can always retrieve the widget manager owner from a session context, even if the session context does not have kernel attached. This gets rid of the exception when retrieving the kernel ID from session context with no kernel:

plugin.ts:153 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'kernel')
    at getWidgetManagerOwner (plugin.ts:153:34)
    at async registerWidgetHandler (plugin.ts:175:25)
    at async plugin.ts:424:7

ipywidgets works properly after attaching ipykernel to a notebook that initially has no kernel after applying this fix.

Kontinuation avatar Jan 17 '25 11:01 Kontinuation