Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
baseIndexOf
✓ const baseIndexOf = require('lodash._baseindexof');
This package is a CommonJS module from the Lodash v3 era. For modern Lodash (v4+), prefer named imports from 'lodash' or 'lodash-es' for functions like 'indexOf'.
indexOf
✓ import { indexOf } from 'lodash';
✗ import baseIndexOf from 'lodash._baseindexof';
The modern, tree-shakeable way to get equivalent functionality in Lodash v4+. The function name is typically `indexOf`, not `baseIndexOf` for public API.
indexOf
✓ import indexOf from 'lodash/indexOf';
✗ require('lodash/indexOf')
A common way to import individual functions from Lodash v4+ in Node.js environments that support ESM syntax or with bundlers. This pattern is not applicable to `lodash._baseindexof`.
Demonstrates how to import and use the `baseIndexOf` function from this legacy CommonJS module, highlighting its strict equality comparison.
const baseIndexOf = require('lodash._baseindexof');
// Example usage of baseIndexOf, which is similar to Array.prototype.indexOf
const numbers = [10, 20, 30, 40, 20];
console.log('Finding 30:', baseIndexOf(numbers, 30, 0)); // Expected: 2
console.log('Finding 20 from index 2:', baseIndexOf(numbers, 20, 2)); // Expected: 4
console.log('Finding 50 (not found):', baseIndexOf(numbers, 50, 0)); // Expected: -1
const objects = [{ id: 1 }, { id: 2 }, { id: 1 }];
// Note: baseIndexOf performs strict equality (===), so it won't work for objects directly.
console.log('Finding {id:1} (object equality):', baseIndexOf(objects, { id: 1 }, 0)); // Expected: -1
console.log('This module is part of Lodash v3 and uses CommonJS `require`.');
console.log('For modern applications, consider `import { indexOf } from "lodash"` or `lodash-es`.');
Debug
Known issues
deprecatedThis package (`lodash._baseindexof` v3.1.0) is a legacy internal module from Lodash v3.x and is no longer actively maintained. Using it in modern applications is discouraged.fixMigrate to using named imports from the main `lodash` package (e.g., `import { indexOf } from 'lodash';`) or `lodash-es` for tree-shakeable builds. affects: <=3.1.0
breakingLodash v4 introduced significant breaking changes compared to v3, including changes in modularization strategy. This package is not compatible with the standard Lodash v4 modular imports.fixRefactor code to use modern Lodash v4+ import patterns, such as `import { indexOf } from 'lodash';` or `import indexOf from 'lodash/indexOf';` for equivalent functionality. affects: >=4.0.0 (for main lodash)
gotchaThis package is a CommonJS module (`require`). Direct `import` statements (ESM) will not work without proper bundler configuration for CJS interoperability.fixEnsure your build system (e.g., Webpack, Rollup) is configured to handle CommonJS modules if you must use this legacy package. Otherwise, migrate to an ESM-compatible Lodash import.
affects: >=3.1.0
Errors
Common errors & fixes
TypeError: baseIndexOf is not a function
Attempting to use `baseIndexOf` after an incorrect or failed import, or if the module itself wasn't resolved correctly.
fixVerify the `require('lodash._baseindexof')` statement is correct and that the package is installed. Ensure you're in a CommonJS environment or that your bundler correctly handles CJS imports for this legacy package. Error: Cannot find module 'lodash._baseindexof'
The package is not installed, or your environment is trying to resolve it as an ESM module without CJS fallback.
fixRun `npm install lodash._baseindexof` or ensure your bundler (like Webpack) is configured with aliases or fallbacks if you're trying to use a different Lodash import path. Consider migrating to modern Lodash imports.
Audit
Dependencies
No dependency data recorded yet.