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

Add reference for BigInt serialization TypeError #34675

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

Josh-Cena
Copy link
Member

Part of mdn/mdn#505

@Josh-Cena Josh-Cena requested a review from a team as a code owner July 6, 2024 17:52
@Josh-Cena Josh-Cena requested review from wbamberg and removed request for a team July 6, 2024 17:52
@github-actions github-actions bot added Content:JS JavaScript docs size/m [PR only] 51-500 LoC changed labels Jul 6, 2024

## What went wrong?

You are trying to serialize a BigInt value using `JSON.stringify`, which does not support BigInt values by default.Sometimes, JSON stringification happens implicitly in libraries, as part of data serialization. For example, sending data to the server, storing it in external storage, or transferring it between threads would all require serialization, which is often done using JSON.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You are trying to serialize a BigInt value using `JSON.stringify`, which does not support BigInt values by default.Sometimes, JSON stringification happens implicitly in libraries, as part of data serialization. For example, sending data to the server, storing it in external storage, or transferring it between threads would all require serialization, which is often done using JSON.
You are trying to serialize a BigInt value using `JSON.stringify`, which does not support BigInt values by default. Sometimes, JSON stringification happens implicitly in libraries, as part of data serialization. For example, sending data to the server, storing it in external storage, or transferring it between threads would all require serialization, which is often done using JSON.
@sideshowbarker sideshowbarker merged commit ee5df97 into mdn:main Jul 10, 2024
7 checks passed
@sideshowbarker
Copy link
Collaborator

…and prematurely merged once again. Sorry, I’ll take a break for a while now…

@Josh-Cena Josh-Cena deleted the bigint-serialize branch July 10, 2024 02:51
@Josh-Cena
Copy link
Member Author

...Oops! Well let's see if anyone complains...

evelinabe pushed a commit to evelinabe/mdn-content that referenced this pull request Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:JS JavaScript docs size/m [PR only] 51-500 LoC changed
2 participants