Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


undefined (reading 'indexOf')
#1
Hello
I have done a fresh install of Moode 8.3.2 onto a Raspberry Pi 3. The pi is getting it's ip address via a DHCP reservation.
When I open the web interface I can see the below error in the console. This error is stuck in a loop and keeps appearing - 1300 calls to it at the moment and counting.
I see the same when I open the admin pages and if they do open they then lockup on saving:
Code:
    playerlib.js:968 Uncaught TypeError: Cannot read properties of undefined (reading 'indexOf')
   at Object.success (playerlib.js:968:32)
   at u (jquery-1.8.2.js:974:30)
   at Object.fireWith [as resolveWith] (jquery-1.8.2.js:1082:7)
   at N (jquery-1.8.2.js:7788:14)
   at XMLHttpRequest.n (jquery-1.8.2.js:8500:8)

Has anyone else encountered this problem?
Reply
#2
(05-12-2023, 07:16 AM)danbuntu Wrote: Hello
I have done a fresh install of Moode 8.3.2 onto a Raspberry Pi 3. The pi is getting it's ip address via a DHCP reservation.
When I open the web interface I can see the below error in the console. This error is stuck in a loop and keeps appearing - 1300 calls to it at the moment and counting.
I see the same when I open the admin pages and if they do open they then lockup on saving:
Code:
    playerlib.js:968 Uncaught TypeError: Cannot read properties of undefined (reading 'indexOf')
   at Object.success (playerlib.js:968:32)
   at u (jquery-1.8.2.js:974:30)
   at Object.fireWith [as resolveWith] (jquery-1.8.2.js:1082:7)
   at N (jquery-1.8.2.js:7788:14)
   at XMLHttpRequest.n (jquery-1.8.2.js:8500:8)

Has anyone else encountered this problem?

Hi,

it's weird, as it appears the image url is not defined...
Code:
if (MPD.json['coverurl'].indexOf('default-cover-v6') === -1)

I see other lines of code reading MPD.json['coverurl'], and they also check if the member exists (here such check is not present, hence the errors).

@Tim Curtis, maybe we should ensure that ['coverurl'] is always there, instead of adding checks for its existence, or have it be an empty string if it happens to be null?
Reply
#3
A quick look at the code and the checks in the JS are just to avoid styling the UI background when there is no cover art, i.e., the variable 'coverurl' has been set to the default moOde cover art image.

The variable 'coverurl' is created in function enhanceMetadata in file /inc/mpd.php. If it doesn't exist after moOde starts then most likely something upstream is broken for example MPD has crashed or something like that.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#4
I've solved this and got it working.

I had completely missed that the install process had changed. I was downloading the image from the website and flashing with etcher.
When I switched to the raspberry pi imager and enabled ssh it all started to work nicely.
Reply


Forum Jump: