[Nuxt Devtools] fail on string-serialized bigint
Hi! I'm currently getting an error in my console when i try to display in the payload tab of the devtools a string which contains a bigint value serialized as string (due to JSON limitations & JS Number limits)
Repro of the issue:
- open https://stackblitz.com/edit/github-guforx?file=app.vue
- open the devtools
- go on the payload tab
- try to see the value of "myId"
- an error similar to the one in the screenshot should be in the console
I tried to investigate a bit the error, here is what i have found it is helpful:
The error is from
Destr
, however it gets called by another func that i cannot understood from what dependency it is from, provably @nuxt/devtools
itself?.
To me it seems that the function Jw
in the minimized code (that uses a regex to check if the string is a number in a string form) is returning true
, however Destr
doing the same check returns false
as the Destr
Regexp
for handling number has a limit of 16/17 chars provably due to JSON.parse
going to truncate the number if left unchecked.
Adding anything to make Jw
fail it's regex test fixes the error. as the value is then returned as is by another function in the callstack
My guess is this is for the display of numbers as numbers instead of strings in the devtools causing this issue with a bigint1 Reply
for reference from the erroring file: