Hi All,
Just fixed an issue regarding this error on a Moodle 3.2 setup.
It turned out to be permissions (of all things!) on some unused theme files - They were set to root.
Upon resetting permissions for the whole /theme directory to apache it instantly stopped the undefined error.
Hopefully this helps!
- Connor