Cannot read property '_rehover'
See original GitHub issueI’m leveraging react-plotly for a project and getting the following error,
Error while plotting: TypeError: Cannot read property '_rehover' of undefined
at push../node_modules/plotly.js/src/plots/plots.js.plots.rehover (plots.js:2814)
at Object.push../node_modules/plotly.js/src/lib/index.js.lib.syncOrAsync (index.js:413)
at continueAsync (index.js:408)
That line of code is:
plots.rehover = function (gd) {
if (gd._fullLayout._rehover) {
gd._fullLayout._rehover();
}
};
I’m not sure if this is a react-plotly.js or regular plotly.js issue, since the code it’s erroring on is regular plotly.js code. It seems that plots.rehover
is being called after the plot has been unmounted (that is purge
has already been called).
Am I doing something wrong?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Setting state in OnMouseOver event returns TypeError ...
MyClass.js:265 Uncaught TypeError: Cannot read property 'reserved' of undefined at MyClass._this._onRenderCell.
Read more >Dash app with js clientside callback sometimes crashes
... TypeError: Cannot read property '_subplot' of undefined at ... at v.rehover (plotly-1.49.4.min.js?v=1.2.0&m=1570107433:7) at Object.l.
Read more >React/Redux Render Error: 'TypeError: Cannot read property ...
Trying to access a property of null throws 'Uncaught TypeError: Cannot read property [propertyName] of null'. Instead of the status value ...
Read more >Solved: Hover Label in interactive html - JMP User Community
Solved: I have defined a column as label, because I want to see the data in my standard graphs. But I don't want...
Read more >In Re Hover Motors, 217 P.2d 863, 121 Colo. 439
"Section 6. Section 54, of Chapter 142, 1935 Colorado Statutes Annotated, is hereby amended to read as follows: "Section 54. Average of Merchandise...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not sure how this can happen (a reproducible example could help 😏 ), but it would be easy to add an additional safe-guard in
rehover
:Ok, so it absolutely (as per usual) was my code causing this to happen, so it might not be worth the effort.
In my code an async request to the server updates a Redux state which updates a parent component of my react-plotly component. At the same time, though, it starts unmounting everything to change pages, so as plotly is trying to re-render, I’m destroying everything. I suppose by the time the
_rehover
function tries to be executed (as a result of the re-render), Plotly has probably purged the graph div of all its Plotly attributes (as a result of the unmounting).