CkEditor Cannot set property 'dir' from undefined

I want to use CKEditor.

I am currently installing CKEditor using npm

Therefore, it is installed in the node_modules folder

My folder structure is similar to

app → index.js

node_modules -> ckeditor -> ...

and I demanded it in index.js

also set a variable before initializing the library

 var CKEDITOR_BASEPATH = '../node_modules/ckeditor'

still getting dir error

offer some help

+4
source share
2 answers

Try to change

var CKEDITOR_BASEPATH = '../node_modules/ckeditor';

to

window.CKEDITOR_BASEPATH = '../node_modules/ckeditor/';

Do not forget the trailing slash in the directory

And try putting a window declaration over your ckeditor import

: http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Specifying_the_Editor_Path

+2

NoToBagels . , jQuery doc ready, CKEDITOR_BASEPATH. , javascript .

0

Source: https://habr.com/ru/post/1667122/


All Articles