Editor.js: Error when leaving page before form with Editor.js is fully loaded

Created on 18 Apr 2019  路  4Comments  路  Source: codex-team/editor.js

I added Editor.js in my React app (via this wrapper)

When I go to the page with a form containing the Editor.js react component, and leave the page before Editor.js was fully loaded (I notice there is a little delay during which a loader is spinning in the textarea), it "breaks" my app, showing only a blank page with the following error in browser's console :

TypeError: Cannot read property "'disconnect'" of undefined

The error doesn't seem to be related to the React wrapper, as it is not modifying the MutationObserver's disconnect function ; I'd like to know if people using Editor.js directly also face this issue

Don't know if this would fix the issue, but I can do a PR checking if this.observer is defined/not null before disconnecting here :

public destroy() {
    this.mutationDebouncer = null;
    this.observer.disconnect();
    this.observer = null;
  }
bug

Most helpful comment

It seems to be an issue with the react-editor.js wrapper. I opened an issue on this topic over there.

All 4 comments

Thanks for the report. Please, feel free to send a PR, we will test it and add to the next release.

i meet this problem too , but also in react app .

Couldn't reproduce the issue with Editor.js on a simple app (No React or whatever)

I'll have to do some more tests in React env before submitting a PR

It seems to be an issue with the react-editor.js wrapper. I opened an issue on this topic over there.

Was this page helpful?
0 / 5 - 0 ratings