Packages

effect

4.1.4 · 11 Nov 2026MIT67.1M / weekRepositoryHomepagenpmAtom feed

Your version

3.12.12

14 Feb 2025Where it was published

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

Release note

Patch Changes

  • Schema: Add missing support for tuple annotations in TaggedRequest.

  • Schedule: Fix unsafe tapOutput signature.

    Previously, tapOutput allowed 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 function

    After (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 length property in Effect.fn / Effect.fnUntraced, closes #4435

    Previously, functions created with Effect.fn and Effect.fnUntraced always had a .length of 0, regardless of their actual number of parameters. This has been fixed so that the length property 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.