{"id":15463,"library":"lodash.findwhere","title":"Lodash `_.findWhere` Legacy Module","description":"The `lodash.findwhere` package provides the `_.findWhere` utility function, originally part of Lodash v3. This standalone module is frozen at version 3.1.0, reflecting the state of the function in the broader Lodash library prior to its major v4 release. `_.findWhere` was deprecated and subsequently removed in Lodash v4 in favor of `_.find` combined with an object shorthand predicate. Consequently, this module is no longer actively maintained or receiving updates, including security patches, that are applied to the modern `lodash` package. Its primary use case now is for maintaining compatibility with legacy codebases tied to Lodash v3, or for selectively importing this specific deprecated functionality into projects that are otherwise on newer Lodash versions but require this exact behavior. Its release cadence is effectively ceased.","status":"deprecated","version":"3.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/lodash/lodash","tags":["javascript","lodash","lodash-modularized","stdlib","util"],"install":[{"cmd":"npm install lodash.findwhere","lang":"bash","label":"npm"},{"cmd":"yarn add lodash.findwhere","lang":"bash","label":"yarn"},{"cmd":"pnpm add lodash.findwhere","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is a CommonJS module from Lodash v3; no ESM import is available or recommended for this specific legacy module.","symbol":"findWhere","correct":"const findWhere = require('lodash.findwhere');"}],"quickstart":{"code":"const findWhere = require('lodash.findwhere');\n\nconst users = [\n  { 'user': 'barney', 'age': 36, 'active': true },\n  { 'user': 'fred',   'age': 40, 'active': false },\n  { 'user': 'pebbles', 'age': 1, 'active': true }\n];\n\n// Find an object where 'age' is 1 and 'active' is true\nconst result = findWhere(users, { 'age': 1, 'active': true });\n\nconsole.log(result); // => { 'user': 'pebbles', 'age': 1, 'active': true }\n\n// This demonstrates the original behavior of _.findWhere, which has been superseded.\n","lang":"javascript","description":"Demonstrates how to import and use the `findWhere` function to find an object in a collection based on a properties object, typical for legacy Lodash v3 usage."},"warnings":[{"fix":"Migrate to `_.find(collection, { property: value })` in Lodash v4+ or newer versions. For example, use `_.find(users, { age: 1, active: true })` instead of `_.findWhere(users, { age: 1, active: true })`.","message":"The `_.findWhere` function was completely removed from the main Lodash library in version 4. This `lodash.findwhere` package provides the v3 implementation and is incompatible with modern Lodash's API for this functionality. Direct use of `_.findWhere` will result in a `TypeError: _.findWhere is not a function` if relying on a v4+ `lodash` bundle.","severity":"breaking","affected_versions":">=4.0.0 (for main lodash)"},{"fix":"Avoid using this standalone module in new projects. For existing projects, prioritize refactoring to use `_.find` with an object predicate from the main `lodash` package to ensure ongoing maintenance and security.","message":"This `lodash.findwhere` package is effectively abandoned. It is frozen at v3.1.0 and will not receive security updates, bug fixes, or enhancements applicable to modern `lodash` versions (v4 and beyond). Continuing to use it may expose projects to unpatched vulnerabilities.","severity":"deprecated","affected_versions":">=3.1.0"},{"fix":"Consolidate to a single `lodash` version (ideally v4+), and use `_.find` with an object predicate for the equivalent functionality. Audit your dependency tree to remove redundant or legacy Lodash modules.","message":"Mixing `lodash.findwhere` (from Lodash v3) with a modern `lodash` (v4+) bundle can lead to unexpected behavior, increased bundle sizes due to duplicate functionality, and potential conflicts. The functionality provided by this module is superseded by a different API.","severity":"gotcha","affected_versions":">=3.1.0"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"Replace `_.findWhere(collection, predicate)` with `_.find(collection, predicate)` from Lodash v4+ or install `lodash.findwhere` explicitly if you must use the legacy function.","cause":"Attempting to use `_.findWhere` after upgrading the main `lodash` package to version 4 or higher, which removed the function.","error":"TypeError: _.findWhere is not a function"},{"fix":"Install `lodash.findwhere` via `npm install lodash.findwhere` if you explicitly intend to use this deprecated module. Otherwise, consider refactoring to use `_.find` from the main `lodash` package.","cause":"The `lodash.findwhere` dependency is not installed or the import path is incorrect, especially in projects not configured for legacy modules.","error":"Cannot find module 'lodash.findwhere'"}],"ecosystem":"npm"}