Multi Output Callback Incorrect Type

While working on my own app I ran into an IncorrectTypeException at my multi output callback. Single output worked just fine. Out of curiosity I also ran the example code from Getting Started Part 2, which then threw had the same problem. I have included the example code as I have copied it, since that is something that shouldn’t have stupid errors. I am using 42.0 and running with jupyter notebook.

import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)

app.layout = html.Div([
    dcc.Input(
        id='num',
        type='number',
        value=5
    ),
    html.Table([
        html.Tr([html.Td(['x', html.Sup(2)]), html.Td(id='square')]),
        html.Tr([html.Td(['x', html.Sup(3)]), html.Td(id='cube')]),
        html.Tr([html.Td([2, html.Sup('x')]), html.Td(id='twos')]),
        html.Tr([html.Td([3, html.Sup('x')]), html.Td(id='threes')]),
        html.Tr([html.Td(['x', html.Sup('x')]), html.Td(id='x^x')]),
    ]),
])


@app.callback(
    [Output('square', 'children'),
     Output('cube', 'children'),
     Output('twos', 'children'),
     Output('threes', 'children'),
     Output('x^x', 'children')],
    [Input('num', 'value')])
def callback_a(x):
    return x**2, x**3, 2**x, 3**x, x**x


if __name__ == '__main__':
    app.run_server(debug=True)

IncorrectTypeException Traceback (most recent call last)
in
30 Output(‘threes’, ‘children’),
31 Output(‘x^x’, ‘children’)],
—> 32 [Input(‘num’, ‘value’)])
33 def callback_a(x):
34 return x2, x3, 2x, 3x, x**x

…appdata\local\programs\python\python37\lib\site-packages\dash\dash.py in callback(self, output, inputs, state)
877 any([isinstance(val, x) for x in valid]) or
878 type(val).name == ‘unicode’
–> 879 )
880
881 def _validate_value(val, index=None):

…appdata\local\programs\python\python37\lib\site-packages\dash\dash.py in _validate_callback(self, output, inputs, state)
667 ‘Same output was used in a’
668 ’ multi output callback!\n Duplicates:\n {}’.format(
–> 669 ‘,\n’.join(
670 k for k, v in
671 ((str(x), output.count(x)) for x in output)

IncorrectTypeException: The output argument [<dash.dependencies.Output object at 0x00000213C48C4E48>, <dash.dependencies.Output object at 0x00000213C49A2DA0>, <dash.dependencies.Output object at 0x00000213C49A2908>, <dash.dependencies.Output object at 0x00000213C49A2F98>, <dash.dependencies.Output object at 0x00000213C49A2668>] is not of type dash.Output.

Any help would be greatly appreciated.

Hi, for me your example is working perfectly fine. Are you sure you updated all dependencies with dash and don’t have other callbacks that has the same outputs?