Uncaught TypeError: Cannot read property 'destruct' of null
See original GitHub issueWhen I go to save I get this error:
app.js:formatted:6369 Uncaught TypeError: Cannot read property 'destruct' of null
at app.js:formatted:6369
at HTMLUnknownElement.callCallback (vendor.js:23251)
at Object.invokeGuardedCallbackDev (vendor.js:23300)
at invokeGuardedCallback (vendor.js:23362)
at flushPassiveEffectsImpl (vendor.js:42844)
at unstable_runWithPriority (app.js:formatted:36153)
at runWithPriority$1 (vendor.js:30582)
at flushPassiveEffects (vendor.js:42748)
at vendor.js:42780
at workLoop (app.js:formatted:36097)
The formatted vendor code is:
Object(e.useEffect)((function() {
var t = u.current;
return u.current = a.Jodit.make(t, i),
u.current.workplace.tabIndex = c || -1,
u.current.events.on("blur", (function(t) {
return l && l(t)
}
)),
u.current.events.on("change", (function(t) {
return s && s(t)
}
)),
d && (t.id = d),
n && (t.name = n),
"function" == typeof p && p(u.current),
function() {
u.current.destruct(),
u.current = t
}
}
Which seems to be this source code: In particular line 47
I’m wondering if the SPA navigates away and the referenced element no longer exists? If I breakpoint the code it doesn’t break, and doesn’t navigate away, but if I remove the breakpoint it goes back to breaking.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:13
Top Results From Across the Web
cannot read property of null doing destructing - Stack Overflow
In Javascript, a variable can be assigned a default, in the case that the value unpacked from the object / array is undefined....
Read more >How to deal or remove "Cannot read property 'destroy' of null"
"Cannot read property 'destroy' of null" - This error has occurred because the underlying js implementation gets failed to initialize the global ......
Read more >Javascript – cannot read property of null doing destructing
Destructing is cool but I start to encounter serious issues when doing destructing of nested objects. I have this code:
Read more >Destructuring assignment - JavaScript - MDN Web Docs
Same as accessing properties, destructuring null or undefined throws a TypeError . const { a } = undefined; // TypeError: Cannot destructure ...
Read more >[Solved]-cannot read property of null doing destructing-Reactjs
In Javascript, a variable can be assigned a default, in the case that the value unpacked from the object / array is undefined....
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 Free
Top 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
We have the same message. We are using React and since updating our dependencies from React-DOM v16 to v17 the error appears everytime the JoditEditor is removed from the viewport, for example like page-navigation or hiding the editor.
No useEffect or hooks!
Any solution to this problem? I used the code presented in the README.md at https://github.com/jodit/jodit-react and I am launching the editor in a modal. The error occurs on both Save and Cancel events of the modal that automatically close the modal as well as the editor.