nestjs-redis icon indicating copy to clipboard operation
nestjs-redis copied to clipboard

Nest can't resolve dependencies of the RedisService - Symbol(REDIS_CLIENT)

Open invertedcrow opened this issue 3 years ago • 7 comments

Hi! Can anyone help me?

On Application start i got this error:

Nest can't resolve dependencies of the RedisService (?). Please make sure that the argument Symbol(REDIS_CLIENT) at index [0] is available in the RedisModule context.

my source

config

import { RedisModuleOptions } from 'nestjs-redis';

export const redis: RedisModuleOptions = {
  name: 'redis',
  host: process.env.REDIS_HOST,
  port: parseInt(process.env.REDIS_PORT),
  db: parseInt(process.env.REDIS_DB),
  password: process.env.REDIS_PASSWORD,
};

module

import { Module } from '@nestjs/common';
import { RedisModule, RedisService } from 'nestjs-redis';
import { MyRedisService } from './redis.service';

import { redis } from './redis.config';
@Module({
  imports: [RedisModule.register(redis)],
  providers: [MyRedisService, RedisService],
  exports: [MyRedisService],
})
export class MyRedisModule {}

service

mport { Injectable } from '@nestjs/common';
import { RedisService } from 'nestjs-redis';

@Injectable()
export class MyRedisService {
  constructor(private readonly _redisService: RedisService) {}
}

invertedcrow avatar Apr 01 '21 14:04 invertedcrow

getting the same when using nest8

augustnmonteiro avatar Jul 02 '21 18:07 augustnmonteiro

Same when using nestjs 8 https://github.com/nestjs/nest/releases/tag/v8.0.0 Now it`s officially released.

alikil avatar Jul 07 '21 12:07 alikil

Encountered the same problem, have you solved it now? @alikil @augustnmonteiro @invertedcrow

aoxiang78 avatar Jul 08 '21 09:07 aoxiang78

+1

rares-lupascu avatar Jul 08 '21 17:07 rares-lupascu

guyz the latest release is from July 2019 ... I am scared to state the obvious :)

rares-lupascu avatar Jul 08 '21 17:07 rares-lupascu

@rares-lupascu there's a newer release here: https://www.npmjs.com/package/nestjs-redis

goranjviv avatar Jul 14 '21 07:07 goranjviv

See also: https://github.com/skunight/nestjs-redis/issues/82

rjpkuyper avatar Oct 07 '21 21:10 rjpkuyper