split
split copied to clipboard
TypeError: Cannot read properties of undefined (reading 'destroy')
I have been unable to reproduce this reliably, but I've seen it a few times in our production React app. The stack trace is something like:
stack: "TypeError: Cannot read properties of undefined (reading 'destroy')\n at tt.componentWillUnmount @ vendor.85bd9274.js:921:106480\n at bj @
Stemming from this line of code:
https://github.com/nathancahill/split/blob/34d2d2a9750ef7f6716dd4e290f56f5f451eeae7/packages/react-split/src/index.js#L103
Based on my understanding of React lifecycle methods, I'm not sure how this is possible. It appears either componentWillUnmount
is called twice or called before componentDidMount
.
In any case, will prevent it: https://github.com/nathancahill/split/pull/723
Just upgraded to react 18 and this error happens on pretty much every usage of split - once in a while it doesn't hit the error, but in general it always does when I change pages (e.x. unmount)
Just upgraded to react 18 and this error happens on pretty much every usage of split - once in a while it doesn't hit the error, but in general it always does when I change pages (e.x. unmount)
i think so, I have almost the same situation as you