I dug around a bit since my personal version (0.2) was still working, but other people reported it no longer working and tracked it down to this fix
If there are no previousChoices, totalChoices will be empty it seems, which breaks the script with the message
TypeError: reduce of empty array with no initial value
I replaced
const totalChoices = [...Object.entries(previousChoices)].map(([, x]) => x).reduce((acc, x) => acc + x);
with
const totalChoices = Object.values(previousChoices).reduce((acc, x) => acc + x, 0);
and tested it both for issues I did not encounter before, and issues I had values for, and this fixed it.