Search code examples
javascripthtmlckeditor

Why CKEDITOR.replace not working in 2023?


I just downloaded CKEditor to use the WYSIWYG editor on my website, but this code:

<!DOCTYPE html>
<html>
  <head>
     <meta charset="utf-8">
     <title>A Simple Page with CKEditor</title>
  </head>
  <body>
     <form>
        <textarea name="body" id="body">
           This is my textarea to be replaced with CKEditor.
        </textarea>
        <script src="http://localhost:8000/ckeditor/ckeditor.js"></script>
        <script>
           CKEDITOR.replace('body');
        </script>
     </form>
  </body>
</html>

I get this error

error


Solution

  • The error message contains a link with a good explanation. Taken from https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#invalid-license-key:

    Description: The editor license key for the LTS (“Long Term Support”) version is missing or invalid. That version of the editor is only available under commercial terms (“Extended Support Model”) for anyone looking to extend the coverage of security updates and critical bug fixes.

    Keep in mind that CKEditor 4 is EOL since June 2023. You should either use a (payed) license key, use the last CKEditor version without the warning (v4.22.1), or update your application to use CKEditor 5 (which is available since years)