Skip to content

fix: Payload tab not showing bigints values #744

Closed
@Fleny113

Description

@Fleny113

🐛 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions