You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading version 9 to version 10, existing code is not working and the decorators are removed in new version 10.
A clear and concise description of what the bug is.
src/databases/redis.service.ts:1:10 - error TS2305: Module '"@liaoliaots/nestjs-redis"' has no exported member 'InjectRedis'.
1 import { InjectRedis } from '@liaoliaots/nestjs-redis';
~~~~~~~~~~~
Below is implementation that is working in v9.
src/databases/redis.service.ts:1:10 - error TS2305: Module '"@liaoliaots/nestjs-redis"' has no exported member 'InjectRedis'.
1 import { InjectRedis } from '@liaoliaots/nestjs-redis';
~~~~~~~~~~~
maheshupasani
changed the title
InjectRedis and CacheModule has no exported member
Module '"@liaoliaots/nestjs-redis"' has no exported member 'InjectRedis'
Oct 10, 2024
import{RedisService}from'@liaoliaots/nestjs-redis';// ...constructor(// ...privatereadonlyredisService: RedisService,// Or ClusterService depending on your situation// ...){
Then update your usage:
// Instead of this:this.redis.setnx(...)// or whatever operation you want// You'll do this:this.redisService.getOrThrow().setnx(...)// there's also a getOrNil(), in either case, it's up to you to figure out error handling
After upgrading version 9 to version 10, existing code is not working and the decorators are removed in new version 10.
A clear and concise description of what the bug is.
src/databases/redis.service.ts:1:10 - error TS2305: Module '"@liaoliaots/nestjs-redis"' has no exported member 'InjectRedis'.
1 import { InjectRedis } from '@liaoliaots/nestjs-redis';
~~~~~~~~~~~
export class RedisService {
constructor(@InjectRedis() private readonly redisClient: Redis) { }
}
Steps to reproduce
Below is implementation that is working in v9.
src/databases/redis.service.ts:1:10 - error TS2305: Module '"@liaoliaots/nestjs-redis"' has no exported member 'InjectRedis'.
1 import { InjectRedis } from '@liaoliaots/nestjs-redis';
~~~~~~~~~~~
export class RedisService {
constructor(@InjectRedis() private readonly redisClient: Redis) { }
}
Expected behavior
It should work after upgrading it to v10 from v9
Environment
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: