Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callbacks with no output and pattern MATCH not allowing dash to run #2944

Open
micmizer opened this issue Aug 8, 2024 · 1 comment
Open
Labels
bug something broken P3 backlog

Comments

@micmizer
Copy link

micmizer commented Aug 8, 2024

Using a callback with no output in Dash 2.17.1 and using a MATCH pattern on the input from a data table prevents dash from loading.

Describe your context
Create a simple single file app with a data table and a pattern matching callback with no output.

This works:

@callback(
    Input({'type': 'data-table', 'index': ALL}, 'active_cell'),
    State('url', 'pathname'),
)
def print_table_id_and_column(active_cell, pathname):
    print("hello")

This however causes the app to not load at all. The only indication of an issue is in the browser console. screenshot provided below:

@callback(
    Input({'type': 'data-table', 'index': MATCH}, 'active_cell'),
    State('url', 'pathname'),
)
def print_table_id_and_column(active_cell, pathname):
    print("hello")

Environment:

pip list | grep dash
dash                      2.17.1
dash-bootstrap-components 1.5.0
dash-bootstrap-templates  1.1.2
dash-core-components      2.0.0
dash-extensions           1.0.14
dash-html-components      2.0.0
dash-iconify              0.1.2
dash_mantine_components   0.14.4
dash-table                5.0.0

Describe the bug

Uncaught error TypeError: Cannot read properties of undefined (reading 'id') prevents dash from running.

Expected behavior

I expect that using a callback with no output works with both ALL and MATCH pattern matching.

Screenshots

image
@gvwilson gvwilson added feature something new P3 backlog bug something broken labels Aug 13, 2024
@gvwilson gvwilson changed the title [BUG] Callbacks with no output and pattern MATCH not allowing dash to run Callbacks with no output and pattern MATCH not allowing dash to run Aug 13, 2024
@gvwilson gvwilson removed the feature something new label Aug 13, 2024
@aGitForEveryone
Copy link
Contributor

This is the same issue as in #2462. Dash requires that if you use MATCH in the input, it should also appear in the output. The referenced issue also requested this restriction to be removed now that we can have callbacks with duplicate outputs. No idea, where on the roadmap this issue is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P3 backlog
Projects
None yet
Development

No branches or pull requests

3 participants