'drawclosedpath' button not recognised by Dash version 1.9 when using 'modeBarButtonsToAdd' or 'modeBarButtons'

When trying to add non-default modebar buttons using modeBarButtonsToAdd, following error appears: ‘must provide button ‘name’ in button config error occurs’ yet correct name have been used according to docs?

Dash Version: 1.9 (these buttons are updated in Dash version 1.12

Docs for buttons in Dash framework: dcc.Graph config options plotly.js/buttons.js at master · plotly/plotly.js · GitHub

import plotly.express as px
import numpy as np
import dash
import dash_core_components as dcc
import dash_html_components as html

#simple image
img_rgb = np.array([[[255, 0, 0], [0, 255, 0], [0, 0, 255]],
                    [[0, 255, 0], [0, 0, 255], [255, 0, 0]]
                   ], dtype=np.uint8)
fig = px.imshow(img_rgb)

config = {'displaylogo': False, 'modeBarButtonsToAdd': ['drawclosedpath', 'eraseshape'],}

#Dash application with graph
app = dash.Dash()
app.layout = html.Div([
    dcc.Graph(figure=fig, config=config)

app.run_server(debug=True, use_reloader=False)

modeBarButtonsToAdd doesn't appear to be working as intended similar issue but only seems to work with default modebar buttons

Any help would be appreciated, thankyou.