You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed a bug while using safeParse and safeParseAsync. Those methods IMO shouldn't throw any errors. Instead, they should hold error in returned object. However, currently this does not work in case of coerced big integers.
Catched: TypeError: Cannot convert undefined to a BigInt
at BigInt (<anonymous>)
at ZodBigInt._parse (/home/aleksander/projects/zod-bigint-error/node_modules/zod/lib/types.js:1205:26)
at ZodObject._parse (/home/aleksander/projects/zod-bigint-error/node_modules/zod/lib/types.js:1864:37)
at ZodObject._parseSync (/home/aleksander/projects/zod-bigint-error/node_modules/zod/lib/types.js:146:29)
at ZodObject.safeParse (/home/aleksander/projects/zod-bigint-error/node_modules/zod/lib/types.js:176:29)
at Object.<anonymous> (/home/aleksander/projects/zod-bigint-error/index.js:10:25)
at Module._compile (node:internal/modules/cjs/loader:1469:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
at Module.load (node:internal/modules/cjs/loader:1288:32)
at Module._load (node:internal/modules/cjs/loader:1104:12)
The text was updated successfully, but these errors were encountered:
Hi,
I noticed a bug while using safeParse and safeParseAsync. Those methods IMO shouldn't throw any errors. Instead, they should hold error in returned object. However, currently this does not work in case of coerced big integers.
Here's an example snippet:
Excepted output
RESULT ok?: false
Actual output
The text was updated successfully, but these errors were encountered: