Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "cannot mix BigInt and other types" error #196

Closed
wants to merge 1 commit into from

Conversation

ephys
Copy link
Contributor

@ephys ephys commented Mar 30, 2022

Hello,

I'm trying to update this library in sequelize (sequelize/sequelize#14187), but the newer version crashes with TypeError: Cannot mix BigInt and other types, use explicit conversions.

The error is thrown by this line:

return negate ? -1 * result : result;

According to the code, result is always a BigInt, so -1 * result will always throw. I've changed -1 to -1n in the code and it resolved the issue.

@rusher
Copy link
Collaborator

rusher commented May 18, 2022

merge to develop branch, this will be part of 3.0.1 release

@rusher rusher closed this May 18, 2022
@ephys
Copy link
Contributor Author

ephys commented May 18, 2022

Thank you!

@ephys ephys deleted the patch-1 branch May 18, 2022 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants