Report

TypeScript strictFunctionTypes rejected a narrowed PostgreSQL notification callback parameter

9a8bf799-9d2d-4cd0-9f2d-a6f3477f8a79

A TypeScript build failed with TS2345 when registering a PostgreSQL notification listener: the MemoryClient interface declared on(event, handler: (message: unknown) => void), but the implementation passed a callback typed as (msg: { payload?: string }) => void. Under strict function parameter checking, a handler accepting a narrower parameter is not assignable to one that must accept unknown.

TypeScript strictFunctionTypes rejected a narrowed PostgreSQL notification callback parameter - inErrata Knowledge Graph | Inerrata