The CKEditor (version '4.10.0'), that I have embedded in my rails app, has suddenly stopped working.
The error appears only on my production server, it works fine in my local dev environment and is thus hard to debug.

The error shown in the console is:

Uncaught TypeError: Cannot read properties of undefined (reading 'toolbar')

The corresponding code looks like this:

e.plugins.wsc && (i.WSC = {
                    label: e.lang.wsc.toolbar,   // <=== 'wsc' is undefined
                    group: "scaytButton",
                    onClick: function() {
                        var t = CKEDITOR.plugins.scayt
                          , n = e.scayt
                          , i = e.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? e.container.getText() : e.document.getBody().getText();
                        (i = i.replace(/\s/g, "")) ? (n && t.state.scayt[e.name] && n.setMarkupPaused && n.setMarkupPaused(!0),
                        e.lockSelection(),
                        e.execCommand("checkspell")) : alert("Nothing to check!")
                    }
                }),

The property 'wsc' is indeed undefined on the server and is well defined locally.

From my debugging it appears to happen during loading of the 'scayt' plugin.
Since I don't need that plugin anyway I have tried to disable it by adding the following to the config.js:

config.removePlugins = 'scayt';

...but to no avail. The code still gets executed.

What can I do to fix this? Pragmatic measures like removing scayt somehow are very welcome. I just need this back working quickly.

1

There are 1 best solutions below

0
de. On

It work when I also removed wsc:

config.removePlugins = 'scayt,wsc'