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: Payload tab not showing bigints values #744

Open
Fleny113 opened this issue Oct 7, 2024 · 0 comments
Open

fix: Payload tab not showing bigints values #744

Fleny113 opened this issue Oct 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Fleny113
Copy link

Fleny113 commented Oct 7, 2024

🐛 The bug

When in the Payload tab a state is expanded it fails to show the value with [destr] Invalid JSON if the value is a string representing a BigInt (a number with more than 16/17 digits). When a string representing a BigInt is in an object the entire object is not get showed due to the same destr error

🛠️ To reproduce

https://stackblitz.com/edit/github-guforx?file=app.vue

🌈 Expected behavior

The value does get showed and there isn't a destr error throwed in the console

ℹ️ Additional context

I did attempt to debug the issue myself a bit:

There is a function that checks if the value is a number with a RegExp and if it returned to be a number it gives the value to destr safeDestr which fails to parse the value as the same "is a string with a number" check is done in destr too however with a limit of 16/17 characters, while the check before did not take that into account, making destr return this Invalid JSON error due to the number being "incompatible" with what JSON.parse due to number truncation.

@Fleny113 Fleny113 added the bug Something isn't working label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant