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
3.6.7: Fix for "Do not know how to serialize a BigInt" #1918
Comments
I have also run into this issue |
JSDoc 3.6.10
function strReplacer (k, v) {
if (typeof v === 'bigint') {
return v.toString() + 'n'
}
return v
}
|
should jsdoc add that by default? manually editing a lib isn't quite right |
Alternative solution without source patching: use .js config with this code: // BigInt JSON serialization.
BigInt.prototype.toJSON = function() {
return this.toString() + 'n';
} Still monkey patch too 😅 . |
This was referenced Dec 9, 2022
2 tasks
This comment was marked as off-topic.
This comment was marked as off-topic.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I'm using BigInts in my code I get this error message
Do not know how to serialize a BigInt
.I know how to fix this problem, but do not ask me to create a pull request (since I do not have any knowledge of how to do that or any interest).
To fix it replace line
142
in the filelib/jsdoc/util/dumper.js
with:The text was updated successfully, but these errors were encountered: