CKEditor 4: Uncaught TypeError: Cannot read property 'langEntries' of null

前端 未结 3 1127
太阳男子
太阳男子 2021-01-06 00:56

I\'m using the Ruby gem for CK Editor (https://github.com/galetahub/ckeditor) and I\'m getting this error:

Uncaught TypeError: Cannot read property \'langEnt         


        
3条回答
  •  Happy的楠姐
    2021-01-06 01:08

    The problem comes from the way rails compiles the assets. It generates one big js file and if your plugin.js code does not load before the files in the /lang it throws an error and stops the execution of the generated by rails big js file. This means if you have any js code past the point where the error occurred it won't be executed as well. Here is what helped me solve the problem:

    //= require ckeditor/init
    //= require ckeditor/config
    //= require ckeditor/plugins/YOUR_PLUGIN/plugin    // plugin.js in folder
    //= require ckeditor/plugins/YOUR_PLUGIN/lang/en   // en.js in folder
    //= require_directory .
    

提交回复
热议问题