Error showing the Mocca calendar

Hello,

I use v2.7.3
I’ve just realized I cannot display nor edit events for any calendar.
(Somehow it was working before…)

For example when clicking on the calendar menu

Error: Script error for “jquery”, needed by: fullcalendar http://requirejs.org/docs/errors.html#scripterror require.min.js:7:290
F https://xwiki.r-mes.ovh/xwiki/webjars/wiki:xwiki/requirejs/2.2.0/require.min.js?r=1:7
onScriptError https://xwiki.r-mes.ovh/xwiki/webjars/wiki:xwiki/requirejs/2.2.0/require.min.js?r=1:30
enter resource://devtools/server/actors/utils/event-loop.js:118
enter self-hosted:1007
_pushThreadPause resource://devtools/server/actors/thread.js:187
onExceptionUnwind resource://devtools/server/actors/thread.js:1603
onExceptionUnwind self-hosted:1011
https://xwiki.r-mes.ovh/xwiki/bin/jsx/TaskManager/TaskManagerSheet?language=fr&docVersion=1.1:1
https://xwiki.r-mes.ovh/xwiki/bin/jsx/TaskManager/TaskManagerSheet?language=fr&docVersion=1.1:1

and when on the calendar

Error: Script error for “jquery”, needed by: fullcalendar http://requirejs.org/docs/errors.html#scripterror require.min.js:7:290
F https://xwiki.r-mes.ovh/xwiki/webjars/wiki:xwiki/requirejs/2.2.0/require.min.js?r=1:7
onScriptError https://xwiki.r-mes.ovh/xwiki/webjars/wiki:xwiki/requirejs/2.2.0/require.min.js?r=1:30

Please give a hand !

Hi,

Can you confirm that you have on your instance FullCalendar dependecy version 2.1.9 and not 2.2?
This could have been updated through another application or manually and the minimum supported version for this application is 2.1.9.

Thanks

Dear Oana,

Here is the screenshot for the versions of the extensions. It’s 2.1.9, but should I update manually to 2.2, or absolutely not ?
Then what is your advice ?
Many thanks !
Caroline

version-extensions-calendar

Hi Caroline,

You should definitely not, since this application supports for now 2.1.9. I just wanted to be sure that this upgrade was not the source of your error.

Also, you are using the last version of Mocca Calendar. You reproduced this errors since you did the upgrade? Or everything worked fine after you did it?

Thanks !
In fact I updated mocca to try and fix the problem, but I had it before ! And I still have it unfortunately.

Maybe @ClemensRobbenhaar has an idea

Oh, this looks strange. Basically the error message complains that the calendar is missing the required “jQuery” library.

This should be available as https://xwiki.r-mes.ovh/xwiki/webjars/wiki%3Axwiki/jquery/2.2.2/jquery.min.js?r=1 (where I think it is indeed available). However when the browser is trying to load it, this creates a javascript error. As jQuery should be pretty cross-browser compatible, I find this quite unexpected.

Does this error appear when editing a blog post, too? (The selection of the categories a blog post is associated with also depends on jQuery, although this is only optional - I think selecting categories for a blog entry works in any case, just adding new categories on the fly does not.)

Can you tell us which browser you are using?
Maybe there is something in a very recent browser version that breaks jQuery.

Hello @ClemensRobbenhaar, and all,

I don’t have the blog functionality, it is an extension that didn’t install as I don’t have the use of it.
I use Firefox 68.0.1, an I tested with other browser (for example Chrome 78.0) with the same result.
I don’t know if it is linked, but it seems my task manager also as a problem:

Protocol error (unknownError): Could not load the source for https://xwiki.r-mes.ovh/xwiki/bin/jsx/TaskManager/TaskManagerSheet?language=fr&docVersion=1.1.
Error: Failed to fetch https://xwiki.r-mes.ovh/xwiki/bin/jsx/TaskManager/TaskManagerSheet?language=fr&docVersion=1.1. Code 2152924148.
Stack: onResponse@resource://devtools/shared/DevToolsUtils.js:544:16
onStopRequest@resource://gre/modules/NetUtil.jsm:123:17
enter@resource://devtools/server/actors/utils/event-loop.js:118:18
_pushThreadPause@resource://devtools/server/actors/thread.js:187:15
onExceptionUnwind@resource://devtools/server/actors/thread.js:1603:12
@https://xwiki.r-mes.ovh/xwiki/bin/jsx/TaskManager/TaskManagerSheet?language=fr&docVersion=1.1:1:133
@https://xwiki.r-mes.ovh/xwiki/bin/jsx/TaskManager/TaskManagerSheet?language=fr&docVersion=1.1:1:150
Line: 544, column: 16

I don’t know if it can help, when trying to display the mocca calendar I also have warning messages like:

The script at “https://xwiki.r-mes.ovh/xwiki/bin/view/MoccaCalendar/jquery.js” has been loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.

see below

image

Ah, yes, that stuff from the Task Manager helps; it looks related.
Also it does not look like it is some odd issue with some browser version, phew.

The jQuery library should have been loaded from “https://xwiki.r-mes.ovh/xwiki/webjars/wiki%3Atestwiki/jquery/2.2.2/jquery.min.js?r=1" - if it is loaded from “https://xwiki.r-mes.ovh/xwiki/bin/view/MoccaCalendar/jquery.js” you get back a “404 - Not Found” page, which is HTML instead of JavaScript.

I do not think the jquery.js library as been available in this location in any version. I guess the task manager will try to load the “jquery.js” from https://xwiki.r-mes.ovh/xwiki/bin/view/TaskManager/jquery.js ?

The most likely explanation I have for the moment is that the configuration for the “require.js” has not gotten the proper information where to load the jQuery lib. I will try to check if I can somehow reproduce it. (I wondered for a moment if it something like an older tomcat version that does not handle “webjars”, but that is unlikely for a Debian distribution package.)

Many thanks @ClemensRobbenhaar !
For the moment I still try to see how to get the jquery elements… So I didn’t manage to get it work for the moment.

On my side, I still have not been able to reproduce the problem.

If I open the JavaScript Console in my browser and type in: requirejs.s.toSource() this creates a phenomenally long string that starts with:

"({contexts:{_:{config:{waitSeconds:7, baseUrl:\"./\", 
    paths:{
      jquery:\"/xwiki/webjars/wiki%3Axwiki/jquery/2.2.2/jquery.min.js?r=1\",
      bootstrap:\"/xwiki/webjars/wiki%3Axwiki/bootstrap/3.4.1/js/bootstrap.min.js?r=1\",
      'xwiki-meta':\"/xwiki/resources/js/xwiki/meta.js?cache-version=1580921529000\",

(linebreaks added for marginally better readability).
I simply do not have much experience with this require JS debugging … but I guess if you try something similar, then the part for jquery is missing?

oh, and it is possibly unrelated, but I get an error in the console saying something like:

TypeError: cannot use 'in' operator to search for "length" in "Bienvenue sur vo..."

this happens on the home page if I am not logged in, as I am not allowed to access the XWiki.DocumentTree and thus some data is not returned in the proper format.

Interestingly this error message comes from within jquery - that is just the library that is missing in the calendar and task manager. It certainly is loaded on the start page.

1 Like

Dear ClemensRobbenhaar,
I get a similar string, and the jquery part is ok :

paths:{jquery:\"/xwiki/webjars/wiki%3Axwiki/jquery/2.2.2/jquery.min.js?r=1\",

Oh, I now see I have been in the wrong track.
I am able to reproduce the issue by editing the calendar macro by trying to include the “DatePickerExtension” from the wrong (old) place.

Can you please check if the following pages exist in your wiki:

  1. https://xwiki.r-mes.ovh/xwiki/bin/view/MoccaCalendar/Code/Macro
  2. https://xwiki.r-mes.ovh/xwiki/bin/view/MoccaCalendar/Macro

If both exist, could you please remove the second one (the one without “/Code/” in the URL.
Afterwards restart the XWiki service or edit the first page (as an Admin user), just inserting a space somewhere, and roll back to the previous version afterwards.

1 Like

Big Up @ClemensRobbenhaar , it works !! :champagne:
Many thanks !

I still have the TaskManager error (on every page, not only calendar), so I guess it was not related :

TypeError: a is nullTaskManagerSheet:1:133 <anonyme> https://xwiki.r-mes.ovh/xwiki/bin/jsx/TaskManager/TaskManagerSheet?language=fr&docVersion=2.1:1 <anonyme> https://xwiki.r-mes.ovh/xwiki/bin/jsx/TaskManager/TaskManagerSheet?language=fr&docVersion=2.1:1

Very, very late marginal comment:

The error message coming from the TaskManager has been found and fixed and the fix will be released soon. The cause for it turned out to be harmless, so you can ignore it in the mean time.

1 Like

Ok, that’s good news, many thanks again ! :star_struck:
I’m now stuck with https://forum.xwiki.org/t/message-failed-to-lock-the-page-when-tring-to-edit-a-page/7609/6 … if you have ideas on this also, do not hesitate !!!