dash-uploader icon indicating copy to clipboard operation
dash-uploader copied to clipboard

Invalid prop for this component when using 0.7.0a2

Open HudsonMC16 opened this issue 10 months ago • 0 comments

Maybe this should be two separate issues, because I'm stuck in a loop trying to pick between the stable versions and 0.7.0a2. I'm running into issues where the callback doesn't fire when multiple files are uploaded when using 0.6.1, so I'd rather stick to 0.7.0a2.

The following simple example throws several errors when run:

primary_dropdown = (
    dcc.Dropdown(
        ['testing', 'this', 'option'],
        id='primary_dropdown',
        multi=True,
        clearable=True,
        searchable=True,
        style={'margin-top': 5},
    ),
)

file_selection = du.Upload(
    max_file_size=500,
    max_files=5,
    filetypes=['tdms'],
    id='dash_uploader',
    text='Drag and drop here or click to select file',
    default_style={
        'width': 175,
        'minHeight': 2,
        'lineHeight': 2,
        'borderWidth': '1px',
        'borderStyle': 'dashed',
        'borderRadius': '5px',
        'textAlign': 'center',
        'margin': '5px',
        'whiteSpace': 'normal',
    },
)


app.layout = dbc.Container(
    fluid=True,
    children=[
        dbc.Row(
            [
                dbc.Col(file_selection, width='auto'),
                dbc.Col(html.H5('Primary:'), width='auto', style={'margin-top': 10}),
                dbc.Col(primary_dropdown, width=True),

            ]
        ),
    ],
)

@du.callback(output=Output('primary_dropdown', 'options'), id='dash_uploader')
def parse_upload(status: du.UploadStatus):
    if status.is_completed:
        print(status)

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

Running this app causes the following error five times for various properties of the du.UploadStatus object: dashAppCallbackBump, totalFilesSize, uploadedFilesSize, totalFilesCount, and uploadedFileNames

Invalid prop for this component
4:28:37 PM
Property "totalFilesSize" was used with component ID: "dash_uploader" in one of the State items of a callback. 
This ID is assigned to a dash_uploader.Upload_ReactComponent component in the layout, which does not 
support this property. This ID was used in the callback(s) for Output(s): primary_dropdown.options

HudsonMC16 avatar Apr 21 '25 16:04 HudsonMC16