Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor throws an exception when destroyed shortly after it was created #2257

Closed
mlewand opened this issue Jul 25, 2018 · 2 comments · Fixed by #3128
Closed

Editor throws an exception when destroyed shortly after it was created #2257

mlewand opened this issue Jul 25, 2018 · 2 comments · Fixed by #3128
Labels
good first issue Relatively easy to fix. This is a perfect issue if you are willing to create a Pull Request. status:confirmed An issue confirmed by the development team. target:minor Any docs related issue that can be merged into a master or major branch. type:bug A bug.
Milestone

Comments

@mlewand
Copy link
Contributor

mlewand commented Jul 25, 2018

Type of report

Bug

Provide detailed reproduction steps (if any)

There's a possible race condition if you delete the editor right after it was instantiated.

  1. Open codepen demo.
  2. Open JavaScript console.
  3. Click the "Load/Destory" button.

Expected

Nothing happens.

Actual

Uncaught TypeError: Cannot read property 'allow' of undefined exception is being thrown.

Note that it could sometimes require like 3 or 5 attempts to repro.

Other details

Originaly reported in old tracker as #14613.

  • Browser: Any
  • OS: Any
@mlewand mlewand added type:bug A bug. status:confirmed An issue confirmed by the development team. good first issue Relatively easy to fix. This is a perfect issue if you are willing to create a Pull Request. target:minor Any docs related issue that can be merged into a master or major branch. labels Jul 25, 2018
@mlewand
Copy link
Contributor Author

mlewand commented Jul 25, 2018

First solution was introduced in #273 I'll take over it, as it requires tests.

@tahoon-ms
Copy link

Not sure if I should create a separate issue for this, but it is related to editor and DOM elements being destroyed before editor instance is ready.

On Edge, permission denied exceptions are thrown by the wysiwygarea plugin if iframe elements are removed before it fully initializes. Repro https://codepen.io/anon/pen/MZEEJg, but you may have to fix the error above ("Cannot read property 'allow' of undefined") before encountering the iframe-related exceptions.

tahoon-ms added a commit to tahoon-ms/ckeditor-dev that referenced this issue Dec 28, 2018
* Abort loading of plugins if editor was destroyed. This avoids "Cannot read property 'allow' of undefined" errors.
* Add more statements that refer to iframes inside try block in wysiwygarea onDomReady(). Referencing an iframe that is no longer in DOM will throw and exception in Edge.
* Avoid spurious 'editor-destroy-iframe' warning messages. It is a legitimate case for an iframe element to be not present in the case of early destruction of the editor.

Fixes ckeditor#2257
@f1ames f1ames added this to the 4.13.0 milestone Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Relatively easy to fix. This is a perfect issue if you are willing to create a Pull Request. status:confirmed An issue confirmed by the development team. target:minor Any docs related issue that can be merged into a master or major branch. type:bug A bug.
Projects
None yet
3 participants