lzear / votes

JS library for ranked voting systems
https://rank-votes.vercel.app
MIT License
23 stars 1 forks source link

Next.js production env with side effect #75

Closed maiconcarraro closed 1 year ago

maiconcarraro commented 1 year ago

I'm still trying to understand what is exactly the root cause, the only thing I know for sure is that it only happens when I try to use the votes import, if I remove the code reference it works fine.

It's using InstantRunoff to calculate results, it works fine locally, but once I deploy into Vercel it fails and the only error I got is this one: image

Any tip how can I investigate it better or what to do? I already sent Vercel a ticket to follow up as well.

Sentry information:

Crashed in non-app: /var/task/node_modules/votes/dist/votes.cjs.prod.js in InstantRunoff.lastRoundQualified
lzear commented 1 year ago

Hello @maiconcarraro! Sorry I missed the notification for this issue! Thanks for reporting it!

There were a few uses of Array.at which isn't supported by all browsers. I replaced them all.

Can you update the version of votes to 2.0.5 and let me know if you still see this issue, or a similar one?

maiconcarraro commented 1 year ago

hey @lzear it worked, I also tested w/ 2.0.6, thank you very much.