effect
4.1.4 · 11 Nov 2026MIT67.1M / weekRepositoryHomepagenpmAtom feed
3.22.5 is the newest release of 3.x.
In short
1 new4 fixed
Security
2 advisories affect 3.12.12; 3.22.1 fixes them
- HighEffect: ReDoS in Schema.TemplateLiteral compiled regexGHSA-7589-6fvf-x4pw · 19 Nov 2026Fixed in 3.22.1
- HighEffect `AsyncLocalStorage` context lost/contaminated inside Effect fibers under concurrent load with RPCGHSA-38f7-945m-qr2g · 20 Mar 2026Fixed in 3.20.0
Release note
Patch Changes
Schema: Add missing support for tuple annotations in
TaggedRequest.Schedule: Fix unsafe
tapOutputsignature.Previously,
tapOutputallowed using an output type that wasn't properly inferred, leading to potential runtime errors. Now, TypeScript correctly detects mismatches at compile time, preventing unexpected crashes.Before (Unsafe, Causes Runtime Error)
import { Effect, Schedule, Console } from "effect" const schedule = Schedule.once.pipe( Schedule.as<number | string>(1), Schedule.tapOutput((s: string) => Console.log(s.trim())) // ❌ Runtime error ) Effect.runPromise(Effect.void.pipe(Effect.schedule(schedule))) // throws: TypeError: s.trim is not a functionAfter (Safe, Catches Type Error at Compile Time)
import { Console, Schedule } from "effect" const schedule = Schedule.once.pipe( Schedule.as<number | string>(1), // ✅ Type Error: Type 'number' is not assignable to type 'string' Schedule.tapOutput((s: string) => Console.log(s.trim())) )Preserve function
lengthproperty inEffect.fn/Effect.fnUntraced, closes #4435Previously, functions created with
Effect.fnandEffect.fnUntracedalways had a.lengthof0, regardless of their actual number of parameters. This has been fixed so that thelengthproperty correctly reflects the expected number of arguments.Before
import { Effect } from "effect" const fn1 = Effect.fn("fn1")(function* (n: number) { return n }) console.log(fn1.length) // Output: 0 ❌ (incorrect) const fn2 = Effect.fnUntraced(function* (n: number) { return n }) console.log(fn2.length) // Output: 0 ❌ (incorrect)After
import { Effect } from "effect" const fn1 = Effect.fn("fn1")(function* (n: number) { return n }) console.log(fn1.length) // Output: 1 ✅ (correct) const fn2 = Effect.fnUntraced(function* (n: number) { return n }) console.log(fn2.length) // Output: 1 ✅ (correct)Fix Context.Tag inference using explicit generics
Use Map for Scope finalizers, to ensure they are always added
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.