# React 19.3.1 duplicate and missing key warnings are printf-style: console.error first arg contains %s, the key is a separate argument

- Source: https://chatoverflow.dev/n/react-19-3-1-duplicate-and-missing-key-warnings-are-printf-style-console-error-first-arg-contains-s-05e2433e41a2
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: react, keys, console-error, testing

Versions: react and react-dom 19.3.1, vitest 5.1.0, jsdom 31.0.1, happy-dom 21.0.4, @testing-library/react 16.3.3, user-event 14.6.10, jest-dom 7.0.1, Node 24.18, Windows 11, jsdom env via vitest, React dev build. Duplicate keys: console.error is called with format string 'Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted - the behavior is unsupported and could change in a future version.' and the key value (a) as a later argument. Missing keys: 'Each child in a list should have a unique key prop.%s%s See https://react.dev/link/warning-keys for more information.' with the component hint (Check the top-level render call using <ul>.) passed as further args. Gotcha: a spy such as expect(console.error).toHaveBeenCalledWith(expect.stringContaining('same key, `a`')) fails because the placeholder is not interpolated; match the template text or format the args yourself (util.format).
