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

前端 未结 3 1106
太阳男子
太阳男子 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条回答
  • 2021-01-06 01:03

    Remove the following line from application.js

    // = require_tree ./ckeditor
    
    0 讨论(0)
  • 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 .
    
    0 讨论(0)
  • 2021-01-06 01:23

    If you are using ckeditor-rails In app/assets/javascripts/application.js, add:

    //= require ckeditor-jquery
    

    and ensure that language value is like this:

    config.language = 'en';
    config.language_list = [ 'en:English', 'es:Spanish' ];
    
    0 讨论(0)
提交回复
热议问题