Closed
Description
Under certain circumstances, after a React update, the <Plot ../>
component will throw the following error:
factory.js:131 Error while plotting: Error: DOM element provided is null or undefined
at Object../node_modules/plotly.js/src/lib/get_graph_div.js.module.exports [as getGraphDiv] (get_graph_div.js:32)
at Object../node_modules/plotly.js/src/plot_api/plot_api.js.Plotly.react (plot_api.js:2222)
at factory.js:107
at <anonymous>
I added some logging into factory.js
to try and debug (modified factory.js
attached below). Here's the output:
My hypothesis is that if Reacts attempts to update the component quickly enough, the promise scheduled in willComponentUpdate
(https://github.com/plotly/react-plotly.js/blob/master/src/factory.js#L100) may be called after React calls getRef
with null
and before it gets called again with the newly rendered div.
Chrome 64.0.3282.167 Mac
plotly.js 1.34.0
react-plotly.js 1.6.0
Metadata
Metadata
Assignees
Labels
No labels