Open Sun0fABeach opened 4 years ago
Hey @Sun0fABeach, thanks for the detailed bug report.
Dan made a few bug fixes in v5.1.0.
Can you let us know if you are still having the issue in the latest version?
Hi. I upgraded to v5.1.0 and the issue remains. Further observations that might help:
amplitude.js Uncaught TypeError: Cannot set property 'active_index' of undefined
at Object.setActivePlaylist
at handleSongInPlaylistPlayPause
at HTMLLIElement.handle
debug: true
, I get the following console message:
Please provide a songs object for AmplitudeJS to run!
Looks like someone explicitly decided to check for the songs
property and to print that message + abort initialization when it's not there. Since it's possible to define all the songs in the playlist config, that check should be made smarter.
After the merger and release of v5.3.0, we re-opened this and need to revisit how to initialize AmplitudeJS without a playlist. This was fixed in v5.2., but due to a host of other issues, we had to rebase and move forward. I'll explore options to make sure this works without issue.
Issue description
Amplitude doesn't properly initialize if I provide a playlist config containing all the songs, and leave out the songs array.
Environment
Steps to reproduce the issue
songs
array:class="amplitude-play-pause" data-amplitude-song-index="0" data-amplitude-playlist="emancipator"
What is expected?
The song is played.
Additional details / screenshots
I can make it work by providing a dummy element for
songs
like so:Now the song can be played.