Error thrown when I try to console log a ZodError

2 weeks ago 20
ARTICLE AD BOX

I discovered that running console.log on a ZodError would result in an error being thrown.

e.g.

import z from 'zod' const schema = z.string() const { error } = schema.safeParse(3) console.log(error)

example output:

zod error

What's the intended way to do this? I'd like to console log these errors for debugging purposes

asked 2 hours ago

ngood97's user avatar

Read Entire Article