Mehran.akb
Mehran.akb

Reputation: 59

How to fix window.CKFinder is undefined

I want to use ckeditor 5 and ckfinder plugin to upload a file or image. I setup ckeditor and plugins step by step with this link. I can run ckeditor and see ckfinder icon on ckeditor but when click on the icon it will not open thel modal and the error is "window.CKFinder is undefined". please help me to solve this problem.

<script src="../build/ckeditor.js"></script>
<script>
    ClassicEditor.create( document.querySelector( '#editor' ),{
    // Enable the CKFinder button in the toolbar.
    toolbar: [ 'ckfinder' ]
} )
    .then( editor => {
        window.editor = editor;
    } )
    .catch( err => {
        console.error( err.stack );
    } );
</script>

Upvotes: 3

Views: 2107

Answers (1)

hamid niakan
hamid niakan

Reputation: 2861

I had the same problem and included the following script and now everything works fine.

<script src="https://ckeditor.com/apps/ckfinder/3.4.5/ckfinder.js"></script>

added script below ckeditor script

you can also check the following link: https://github.com/ckeditor/ckeditor5-react/issues/86

Upvotes: 2

Related Questions