CkEditor Cannot set property 'dir' of undefined

Try changing

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

to

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

Don't forget the trailing slash on the directory

And try putting the window declaration above your import of ckeditor

Check out this link for more information: http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Specifying_the_Editor_Path


For others with this problem (since it still persists as of the newest version at this time), if you have self-hosted the CKEditor script in your solution (for example for a classic ASP.NET application) and you do not have all the localization files of the plugin in your CKEditor folder, that can cause this issue to happen. I tried using NoToBagels solution, but it changed nothing for me.

We for example only had the en.js file in our /CKEditor/lang/ folder, and the bug occurred when a user that had both english and danish as his browser languages. CKEditor tried to automatically set the language of the editor to Danish, and tried to load the /CKEditor/lang/da.js file, which did not exist (which caused a 404 error). Adding the following to the config.js file fixed the problem for us:

config.language = 'en';

setting config.language ensures that the language of the editor is set to english instead of it being auto detected.