Javascript errors after upgrade

Javascript errors after upgrade

by Jordan Dohms -
Number of replies: 3

Hello,

We recently upgraded from Moodle 3.5 to 3.9 and the upgrade seemed to go without hiccup.

I am now, however, getting an error trying to add activities/resources to a course.  It seems to be a javaScript error.

When I click "Add an activity or resource" (as a site admin) the dialog appears, with a loading spinner and it never loads the list of choices to add.  I've disabled all additional plugins, cleared caches, but still nothing.


In my browser debug console i'm seeing the following:

"Unhandled promise rejection" [object Object]{errorcode: "invaliduser", link: "https://courses...", message: "Invalid user", moreinfourl: "http://docs.moodle.org/39/en/error/moodle/invaliduser"}

in https://courses.../lib/javascript.php/1593791298/lib/babel-polyfill/polyfill.min.js

I'm not seeing any PHP or Apache errors, unfortunately. Anyone have an idea how to track down the source of this issue?  Was it something that went awry with the upgrade?

Average of ratings: -
In reply to Jordan Dohms

Re: Javascript errors after upgrade

by Ken Task -
Picture of Particularly helpful Moodlers

When you say "...cleared caches..." did you do that via Moodle Admin UX or via command line rm -fR moodledata/cache/ and rm -fR moodledata/localcache/

Not a programmer ... but this:

"Unhandled promise rejection" [object Object]{errorcode: "invaliduser"

does look like a javascript issue related to user ...

and for what it's worth ...

git acquired code ... directories moodle35, moodle36, moodle37, moodle38, and moodle39

find ./moodle??/ -name polyfill.min.js
./moodle38//lib/babel-polyfill/polyfill.min.js
./moodle39//lib/babel-polyfill/polyfill.min.js

find ./moodle??/ -name polyfill.js
./moodle37/lib/mdn-polyfills/polyfill.js
./moodle38/lib/mdn-polyfills/polyfill.js
./moodle38/lib/babel-polyfill/polyfill.js
./moodle39/lib/babel-polyfill/polyfill.js
./moodle39/lib/polyfills/polyfill.js

Looks like some mdn and babel-polyfill ...

Hmmm ... I wonder.

'SoS', Ken

In reply to Ken Task

Re: Javascript errors after upgrade

by Jordan Dohms -
Thanks for the reply.  This remains unsolved even after trying a few different things in our dev environment.  We tried clearing caches through the UI and deleting the cache folders through the filesystem.  We also tried multi-stage upgrades, going from 3.5 to 3.7 or 3.8 and then 3.9 instead of one giant upgrade step.  All failed at the 3.9 step.

Anyways, we're going to revise our upgrade plan to stay on 3.8 for now.  We noticed a few of our additional plugins don't have a 3.9 release yet anyways, so we'll revisit it later and maybe we'll have better success.