Patch Changes
-
#4847
24a9ebb
Thanks @gcanti! - Schema: TaggedError no longer crashes when themessage
field is explicitly defined.If you define a
message
field in your schema,TaggedError
will no longer add its ownmessage
getter. This avoids a stack overflow caused by infinite recursion.Before
import { Schema } from "effect" class Todo extends Schema.TaggedError<Todo>()("Todo", { message: Schema.optional(Schema.String) }) {} // ❌ Throws "Maximum call stack size exceeded" console.log(Todo.make({}))
After
// ✅ Works correctly console.log(Todo.make({}))