{"ecosystem":"npm","package":"lru-cache","version":null,"bugs":[{"id":4070,"ecosystem":"npm","package_name":"lru-cache","affected_version":null,"fixed_version":null,"bug_id":"github:383","title":"Fails in TS Strict Mode","description":"We are trying to enable TS strict mode (`\"compilerOptions\": {\"strict\": true}}`, but lru-cache generates the following errors when we try to build our Angular app:\n\n```\n✘ [ERROR] TS2416: Property 'entries' in type 'LRUCache<K, V, FC>' is not assignable to the same property in base type 'Map<K, V>'.\n  Type '() => Generator<[K, V], void, unknown>' is not assignable to type '() => MapIterator<[K, V]>'.\n    Call signature return types 'Generator<[K, V], void, unknown>' and 'MapIterator<[K, V]>' are incompatible.\n      The types returned by 'next(...)' are incompatible between these types.\n        Type 'IteratorResult<[K, V], void>' is not assignable to type 'IteratorResult<[K, V], undefined>'.\n          Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorResult<[K, V], undefined>'.\n            Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorReturnResult<undefined>'.\n              Type 'void' is not assignable to type 'undefined'. [plugin angular-compiler]\n\n    node_modules/lru-cache/dist/commonjs/index.d.ts:973:4:\n      973 │     entries(): Generator<[K, V], void, unknown>;\n          ╵     ~~~~~~~\n\n✘ [ERROR] TS2416: Property 'keys' in type 'LRUCache<K, V, FC>' is not assignable to the same property in base type 'Map<K, V>'.\n  Type '() => Generator<K, void, unknown>' is not assignable to type '() => MapIterator<K>'.\n    Call signature return types 'Generator<K, void, unknown>' and 'MapIterator<K>' are incompatible.\n      The types returned by 'next(...)' are incompatible between these types.\n        Type 'IteratorResult<K, void>' is not assignable to type 'IteratorResult<K, undefined>'.\n          Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorResult<K, undefined>'.\n            Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorReturnResult<undefined>'.\n              Type 'void' is not assignable to type 'undefined'. [plugin angular-compiler]\n\n    node_modules/lru-cache/dist/commonjs/index.d.ts:985:4:\n      985 │     keys(): Generator<K, void, unknown>;\n          ╵     ~~~~\n\n✘ [ERROR] TS2416: Property 'values' in type 'LRUCache<K, V, FC>' is not assignable to the same property in base type 'Map<K, V>'.\n  Type '() => Generator<V, void, unknown>' is not assignable to type '() => MapIterator<V>'.\n    Call signature return types 'Generator<V, void, unknown>' and 'MapIterator<V>' are incompatible.\n      The types returned by 'next(...)' are incompatible between these types.\n        Type 'IteratorResult<V, void>' is not assignable to type 'IteratorResult<V, undefined>'.\n          Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorResult<V, undefined>'.\n            Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorReturnResult<undefined>'.\n              Type 'void' is not assignable to type 'undefined'. [plugin angular-compiler]\n\n    node_modules/lru-cache/dist/commonjs/index.d.ts:997:4:\n      997 │     values(): Generator<V, void, unknown>;\n          ╵     ~~~~~~\n\n✘ [ERROR] TS2416: Property '[Symbol.iterator]' in type 'LRUCache<K, V, FC>' is not assignable to the same property in base type 'Map<K, V>'.\n  Type '() => Generator<[K, V], void, unknown>' is not assignable to type '() => MapIterator<[K, V]>'.\n    Call signature return types 'Generator<[K, V], void, unknown>' and 'MapIterator<[K, V]>' are incompatible.\n      The types returned by 'next(...)' are incompatible between these types.\n        Type 'IteratorResult<[K, V], void>' is not assignable to type 'IteratorResult<[K, V], undefined>'.\n          Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorResult<[K, V], undefined>'.\n            Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorReturnResult<undefined>'.\n              Type 'void' is not assignable to type 'undefined'. [plugin angular-compiler]\n\n    node_modules/lru-cache/dist/commonjs/index.d.ts:1009:4:\n      1009 │     [Symbol.iterator](): Generator<[K, V], void, unknown>;\n           ╵     ~~~~~~~~~~~~~~~~~\n\n✘ [ERROR] TS2416: Property 'forEach' in type 'LRUCache<K, V, FC>' is not assignable to the same property in base type 'Map<K, V>'.\n  Type '(fn: (v: V, k: K, self: LRUCache<K, V, FC>) => any, thisp?: any) => void' is not assignable to type '(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any) => void'.\n    Types of parameters 'fn' and 'callbackfn' are incompatible.\n      Types of parameters 'map' and 'self' are incompatible.\n        Type 'LRUCache<K, V, FC>' is not assignable to type 'Map<K, V>'.\n          The types returned by 'entries().next(...)' are incompatible between these types.\n            Type 'IteratorResult<[K, V], void>' is not assignable to type 'IteratorResult<[K, V], undefined>'.\n              Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorResult<[K, V], undefined>'.\n                Type 'IteratorReturnResult<void>' is not assignable to type 'IteratorReturnResult<undefined>'.\n                  Type 'void' is not assignable to type 'undefined'. [plugin angular-compiler]\n\n    node_modules/lru-cache/dist/commonjs/index.d.ts:1032:4:\n      1032 │     forEach(fn: (v: V, k: K, self: LRUCache<K, V, FC>) => any, thisp?: any): void;\n```\n\nThese errors seem to be with the type definitions of the library, and not our code.","severity":"medium","status":"fixed","source":"github_issues","source_url":"https://github.com/isaacs/node-lru-cache/issues/383","labels":[],"created_at":"2026-04-26 00:47:38.434084+00:00","updated_at":"2026-04-26 00:47:38.434084+00:00"},{"id":4069,"ecosystem":"npm","package_name":"lru-cache","affected_version":"11.3.0","fixed_version":null,"bug_id":"github:396","title":"Memory leak error","description":"After getting `lru-cache` to `11.3.0` I am getting `Eventemitter` memory leak error while running ng test in an angular application\n\n<img width=\"1606\" height=\"77\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/28251ca7-c929-454a-a2ac-5c443890fc15\" />\n\nFixed with overrides for now\n\n```\n\"overrides\": {\n        \"lru-cache\": \"11.2.7\"\n    }","severity":"medium","status":"fixed","source":"github_issues","source_url":"https://github.com/isaacs/node-lru-cache/issues/396","labels":[],"created_at":"2026-04-26 00:47:38.432367+00:00","updated_at":"2026-04-26 00:47:38.432367+00:00"},{"id":4068,"ecosystem":"npm","package_name":"lru-cache","affected_version":"11.3.3","fixed_version":null,"bug_id":"github:399","title":"Importing the package in react-native fails","description":"After updating to the latest version 11.3.3 in our Expo 55 project, we get this error:\n> The package at \"node_modules/lru-cache/dist/esm/index.min.js\" attempted to import the Node standard library module \"node:diagnostics_channel\".\n> It failed because the native React runtime does not include the Node standard library.\n> Learn more: https://docs.expo.dev/workflow/using-libraries/#using-third-party-libraries\n\nWe applied a workaround by manually handling it in our metro.config.ts:\n\n```ts\nconfig.resolver.resolveRequest = (context, moduleName, platform) => {\n    if (moduleName === 'node:diagnostics_channel') {\n        return { type: 'empty' }\n    }\n\n    // ...\n}\n```\n\nIt would be nice if it would natively work. I also reported this to the [relevant Expo discussion](https://github.com/expo/expo/discussions/36551#discussioncomment-16501522).","severity":"medium","status":"fixed","source":"github_issues","source_url":"https://github.com/isaacs/node-lru-cache/issues/399","labels":[],"created_at":"2026-04-26 00:47:38.421478+00:00","updated_at":"2026-04-26 00:47:38.421478+00:00"}],"total":3,"_cache":"hit"}