-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Property 'getClient' does not exist on type 'Store' #14
Comments
no update? |
looking at |
I am still not able to getClient from store. Can someone suggest the workaround? |
|
The issue is that the usage example from the README: https://github.com/dabroek/node-cache-manager-redis-store/blob/04d04cb5e5a472a9f8eb78c59fa1f90eb6df5839/README.md#single-store) no longer works with the latest version of "node-cache-manager": // not awaiting here is the first issue, since caching fn from node-cache-manager was updated in v5 to be async, see https://github.com/node-cache-manager/node-cache-manager#usage-examples
const redisCache = cacheManager.caching({
store: await redisStore(config),
})
// redisCache.store returns an object like: { store: ... }, so can only access getClient on redisCache.store.store
const redisClient = redisCache.store.getClient()
// throws error: TypeError: Cannot read properties of undefined (reading 'getClient') dependencies: It's caused by a breaking change in v5 of node-cache-manager described here which makes passing in a store as is currently described in the README hit the Indeed, downgrading to: "cache-manager": "4.1.0" I've found that if using with "cache-manager": "^5.0.0", even though the call to Probably this package requires an update to be compatible with v5 (which from what I can see is not so likely jaredwray/cacheable#236) |
Getting this error with cache-manager with Typescript
when trying to const redisClient = redisCache.store.getClient()
The text was updated successfully, but these errors were encountered: