Skip to content

UnboundLocalError: cannot access local variable 'params' where it is not associated with a value #7993

@MarcSkovMadsen

Description

@MarcSkovMadsen
Collaborator

I've seen this error multiple times when updating reference guides for Panel Material UI.

Traceback (most recent call last):
  File "/home/jovyan/repos/private/panel-material-ui/.pixi/envs/test-312/lib/python3.12/site-packages/pyviz_comms/__init__.py", line 340, in _handle_msg
    self._on_msg(msg)
  File "/home/jovyan/repos/private/panel-material-ui/.pixi/envs/test-312/lib/python3.12/site-packages/panel/viewable.py", line 500, in _on_msg
    doc.unhold()
  File "/home/jovyan/repos/private/panel-material-ui/.pixi/envs/test-312/lib/python3.12/site-packages/bokeh/document/document.py", line 776, in unhold
    self.callbacks.unhold()
  File "/home/jovyan/repos/private/panel-material-ui/.pixi/envs/test-312/lib/python3.12/site-packages/bokeh/document/callbacks.py", line 441, in unhold
    self.trigger_on_change(event)
  File "/home/jovyan/repos/private/panel-material-ui/.pixi/envs/test-312/lib/python3.12/site-packages/bokeh/document/callbacks.py", line 418, in trigger_on_change
    invoke_with_curdoc(doc, event.callback_invoker)
  File "/home/jovyan/repos/private/panel-material-ui/.pixi/envs/test-312/lib/python3.12/site-packages/bokeh/document/callbacks.py", line 453, in invoke_with_curdoc
    return f()
           ^^^
  File "/home/jovyan/repos/private/panel-material-ui/.pixi/envs/test-312/lib/python3.12/site-packages/bokeh/util/callback_manager.py", line 174, in invoke
    callback(attr, old, new)
  File "/home/jovyan/repos/private/panel-material-ui/.pixi/envs/test-312/lib/python3.12/site-packages/panel/reactive.py", line 559, in _comm_change
    state._handle_exception(e)
  File "/home/jovyan/repos/private/panel-material-ui/.pixi/envs/test-312/lib/python3.12/site-packages/panel/io/state.py", line 488, in _handle_exception
    raise exception
  File "/home/jovyan/repos/private/panel-material-ui/.pixi/envs/test-312/lib/python3.12/site-packages/panel/reactive.py", line 557, in _comm_change
    self._schedule_change(doc, comm)
  File "/home/jovyan/repos/private/panel-material-ui/.pixi/envs/test-312/lib/python3.12/site-packages/panel/reactive.py", line 539, in _schedule_change
    self._change_event(doc)
  File "/home/jovyan/repos/private/panel-material-ui/.pixi/envs/test-312/lib/python3.12/site-packages/panel/reactive.py", line 535, in _change_event
    self._process_events(events)
  File "/home/jovyan/repos/private/panel-material-ui/.pixi/envs/test-312/lib/python3.12/site-packages/panel/reactive.py", line 482, in _process_events
    if len(params) > 1:
           ^^^^^^
UnboundLocalError: cannot access local variable 'params' where it is not associated with a value

Reproduce

  • Run pmui Switch reference guide
  • Open Parameter Editor
  • Set edge parameter to False

Metadata

Metadata

Assignees

No one assigned

    Labels

    TRIAGEDefault label for untriaged issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @MarcSkovMadsen

      Issue actions

        UnboundLocalError: cannot access local variable 'params' where it is not associated with a value · Issue #7993 · holoviz/panel