Wiki editor: Syntax Highlighting and/or Autocompletion failed to load

If I open the wiki syntax editor (syntax is XWiki 2.1) I get a lot of these error messages:

Syntax Highlighting and/or Autocompletion failed to load.

In my developer console I find a lot of 404 for the following files:

https://example.org/webjars/wiki%3Andr/codemirror/5.56.0-xwiki/lib/codemirror.js
https://example.org/webjars/wiki%3Andr/codemirror/5.56.0-xwiki/addon/edit/trailingspace.js
https://example.org/webjars/wiki%3Andr/codemirror/5.56.0-xwiki/addon/edit/closebrackets.js
https://example.org/webjars/wiki%3Andr/codemirror/5.56.0-xwiki/addon/comment/continuecomment.js
https://example.org/webjars/wiki%3Andr/codemirror/5.56.0-xwiki/addon/search/match-highlighter.js
https://example.org/webjars/wiki%3Andr/codemirror/5.56.0-xwiki/addon/selection/active-line.js
https://example.org/webjars/wiki%3Andr/codemirror/5.56.0-xwiki/addon/edit/matchbrackets.js
https://example.org/webjars/wiki%3Andr/codemirror/5.56.0-xwiki/addon/search/matchesonscrollbar.js
https://example.org/webjars/wiki%3Andr/codemirror/5.56.0-xwiki/mode/velocity/velocity.js
https://example.org/webjars/wiki%3Andr/codemirror/5.56.0-xwiki/addon/search/search.js
https://example.org/webjars/wiki%3Andr/codemirror/5.56.0-xwiki/mode/htmlmixed/htmlmixed.js
https://example.org/webjars/wiki%3Andr/codemirror/5.56.0-xwiki/mode/groovy/groovy.js
https://example.org/webjars/wiki%3Andr/codemirror/5.56.0-xwiki/mode/python/python.js

We use XWiki 17.10.13.

Regards, Simpel

Hi, it seems you’re not using the latest version of the Syntax Highligting Application which is 4.11.2 (it depends on CodeMirror 5.65.21 which is newer than the 5.56.0 version I see in your logs).

Hello! The issue is already fixed ( Loading...), but is still reproducible on instances where the server-side resource cache was built before the fix was applied/upgraded to.

To solve this:

  1. Make sure the syntax highlight module is at version 4.11.2 minimum, and codemirror is at version 5.65.21-xwiki minimum, to ensure the fixes are included. If not, upgrade them.
  2. After that, it is very possible that a hard refresh is needed to make sure a new request is sent to the server, so it can extract/re-cache the correct webjar resources.

In the main wiki we had

Syntax Highlighting Application 4.11.2

including dependencies

Syntax Highlighting Common Library 4.11.2
codemirror 5.65.21-xwiki-2

I wonder about “-2”.

I just upgraded Xwiki from 17.10.8 to 18.4.6 and get these errors all the time.

syntax highlighting Version 4.11.2
codemirror Version 5.65.21-xwiki-2

This is the right version. If the URLs used to load the CodeMirror code/resource don’t use this version then you might have a caching issue or something has not been properly upgraded.

Check (using the Network tab from the browser’s developer tools) what URLs are used to load CodeMirror resources. Do they specify the 5.65.21-xwiki-2 version?