Fabrizz / MMM-OnSpotify

Highly customizable MM2 module that displays what you are listening to in Spotify. Compatible with MMM-LiveLyrics and DynamicTheming.
MIT License
53 stars 9 forks source link

Nothing play/No-user #53

Closed Colinwehrhan closed 4 months ago

Colinwehrhan commented 4 months ago

Hi,

I tried following the install process on both a raspberryPi 3 & 4 and got the same problem. Everything seems to setup ok, and authorization success but then when running magicmirror my cover art is displayed, but it never updates now playing.

When looking in the console log I see first:

Refused to apply style from 'http://localhost:8080/css/custom.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
loader.js:190 Error on loading stylesheet: css/custom.css

I then further on get these errors:

Uncaught (in promise) TypeError: moment.duration(...).format is not a function
    at SpotifyDomBuilder.getSanitizedTime (SpotifyDomBuilder.js:1213:35)
    at SpotifyDomBuilder.getPlayerData (SpotifyDomBuilder.js:428:27)
    at SpotifyDomBuilder.nowPlaying (SpotifyDomBuilder.js:236:30)
    at Class.getDom (MMM-OnSpotify.js:233:27)
    at main.js:138:35
    at new Promise (<anonymous>)
    at updateDom (main.js:118:10)
    at Object.updateDom (main.js:676:4)
    at Class.updateDom (module.js:336:6)
    at Class.smartUpdate (MMM-OnSpotify.js:607:21)
SpotifyDomBuilder.js:1213 Uncaught (in promise) TypeError: moment.duration(...).format is not a function
    at SpotifyDomBuilder.getSanitizedTime (SpotifyDomBuilder.js:1213:35)
    at SpotifyDomBuilder.getPlayerData (SpotifyDomBuilder.js:428:27)
    at SpotifyDomBuilder.nowPlaying (SpotifyDomBuilder.js:236:30)
    at Class.getDom (MMM-OnSpotify.js:233:27)
    at main.js:138:35
    at new Promise (<anonymous>)
    at updateDom (main.js:118:10)
    at Object.updateDom (main.js:676:4)
    at Class.updateDom (module.js:336:6)
    at Class.smartUpdate (MMM-OnSpotify.js:612:21)
118SpotifyDomBuilder.js:487 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'style')
    at SpotifyDomBuilder.updatePlayerData (SpotifyDomBuilder.js:487:14)
    at Class.smartUpdate (MMM-OnSpotify.js:618:29)
    at Class.socketNotificationReceived (MMM-OnSpotify.js:330:14)
    at module.js:235:9
    at Socket.<anonymous> (socketclient.js:38:4)
    at Emitter.emit (index.mjs:136:20)
    at Socket.emitEvent (socket.js:498:20)
    at Socket.onevent (socket.js:485:18)
    at MMSocket.socket.onevent (socketclient.js:32:11)
    at Socket.onpacket (socket.js:455:22)
localhost/:1 Refused to apply style from 'http://localhost:8080/css/custom.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
104SpotifyDomBuilder.js:487 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'style')
    at SpotifyDomBuilder.updatePlayerData (SpotifyDomBuilder.js:487:14)
    at Class.smartUpdate (MMM-OnSpotify.js:618:29)
    at Class.socketNotificationReceived (MMM-OnSpotify.js:330:14)
    at module.js:235:9
    at Socket.<anonymous> (socketclient.js:38:4)
    at Emitter.emit (index.mjs:136:20)
    at Socket.emitEvent (socket.js:498:20)
    at Socket.onevent (socket.js:485:18)
    at MMSocket.socket.onevent (socketclient.js:32:11)
    at Socket.onpacket (socket.js:455:22)

It is odd, on the first run of magicMirror it correctly displayed my spotify profile and cover art. After restarting it no longer shows my spotify profile, just my cover art.

Colinwehrhan commented 4 months ago

Did this fix! Working now! https://github.com/Fabrizz/MMM-OnSpotify/issues/27

Fabrizz commented 4 months ago

Thanks! Will fix in the next update, removing moment completely as its used just for two things that can be done relatively easy.