ITADN

TypeError: r.includes is not a function when running with --dep overrides and nested overrides

#1695Opennamit 创建于 2026-04-27
N
namitcommented
Body: ### What is the problem? `npm-check-updates` crashes with `TypeError: r.includes is not a function` when run against a monorepo whose root `package.json` contains nested `overrides` entries (e.g. `"jsdom": { "undici": "7.24.6" }`). ### Reproduction Root `package.json` contains: "overrides": { "jsdom": { "undici": "7.24.6" }, "better-auth": { "defu": "6.1.6" }, "drizzle-kit": { "@esbuild-kit/esm-loader": { "@esbuild-kit/core-utils": "..." } }, "lodash": "4.18.1", "hono": "4.12.11" } .ncurc.js: module.exports = { reject: [ '@ak/shared', '@ak/api', '@ak/web', '@ak/worker', '@ak/contracts', '@ak/db', '@ak/i18n', 'recharts', 'react-resizable-panels', ], }; Command: npx npm-check-updates -u --workspaces --root --dep prod,dev,optional,overrides Stack trace TypeError: r.includes is not a function at /…/node_modules/npm-check-updates/build/index.js:744:2598 at Array.find (<anonymous>) at /…/node_modules/npm-check-updates/build/index.js:744:2585 at Array.reduce (<anonymous>) at Kj (/…/node_modules/npm-check-updates/build/index.js:744:2559) at Jj (/…/node_modules/npm-check-updates/build/index.js:744:3273) at Is (/…/node_modules/npm-check-updates/build/index.js:744:4606) at process.processTicksAndRejections (node:internal/process/task_queues:103:5) at async RC (/…/node_modules/npm-check-updates/build/index.js:773:261) Suspected cause The minified r.includes is not a function looks like code expecting a string/array but receiving an object. Nested override values such as "jsdom": { "undici": "7.24.6" } are objects, not strings — likely the trigger when --dep overrides is enabled. Workaround: removing overrides from --dep (--dep prod,dev,optional) lets the run complete. Environment - npm-check-updates: 20.0.0 - Node.js: v24.13.1 - npm: 11.10.0 - OS: macOS (Darwin 25.4.0, arm64) - Workspaces: yes (apps/*, apps/web/*, packages/*, packages/product/*)
0 条评论