Featured post
- Get link
- X
- Other Apps
Unhandled Runtime Error TypeError: Do not know how to serialize a BigInt
When i was developing a next js application, i got a requirement to work with datatype Bigint.During my coding i got an error
Unhandled Runtime Error TypeError: Do not know how to serialize a BigInt
I was calling an api to update user data which is having a bigint datatype key value pair in the body as shown below.
In order to fix the error what i did that i attached a function definition for toJSON at the prototype of BigInt data type.As we all know BigInt is one of the primitive data type in javavscript.Please check the below code for the function definition for the toJSON method
BigInt.prototype.toJSON = function() { return this.toString() }
By definie the toJSON at prototype of BigInt,I could fix the error ,Unhandled Runtime Error TypeError: Do not know how to serialize a BigInt and i executed the next js project without any error
Popular Posts
How to Check React Version Installed in Your System by Checking PACKAGE.JSON File and Executing Command from COMMAND PROMPT
- Get link
- X
- Other Apps
Execution failed for task ':react-native-reanimated:externalNativeBuildDebug' solved
- Get link
- X
- Other Apps
Error: Invalid `prisma.$executeRaw()` invocation: fixed using log: ["query"] option
- Get link
- X
- Other Apps
ERROR Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined
- Get link
- X
- Other Apps
app keeps stopping error solved in android studio emulator using logcat in react native project
- Get link
- X
- Other Apps