I figured out how to solve this, but figured I’d post about it because the initial symptom was this inscrutable error in the console:
Uncaught TypeError: undefined does not have a method named "concat"(…)
I have an app with tabs and buttons. Some buttons appear on one tab, some buttons appear on the other. I’d set up a callback function to be able to use a dynamic number of buttons like:
@app.callback(Output(OUTPUTDIV, 'children'), [Input(button_id, 'n_clicks') for button_id in BUTTONS]) def button_clicks(*args): for n_clicks in args: #do something
It worked fine with one tab, but when I added a second tab, and a second set of buttons, the app broke. No errors were showing up in Python, but the buttons wouldn’t do anything when clicked anymore. Eventually I found the inscrutable error above, but was puzzled, since the Python code would be able to handle if arguments passed to it were
None so it took me a while to figure out what was happening.
My solution will be to iterate over the tabs and create a
button_clicks() function for each. Maybe this will be a problem for other setups?
None values to the callback