Skip to content
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

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

Open
invertedcrow opened this issue Apr 1, 2021 · 7 comments

Comments

@invertedcrow
Copy link

invertedcrow commented Apr 1, 2021

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) {}
}
@augustnmonteiro
Copy link

getting the same when using nest8

@alikil
Copy link

alikil commented Jul 7, 2021

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

@aoxiang78
Copy link

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

@rares-lupascu
Copy link

+1

@rares-lupascu
Copy link

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

@goranjviv
Copy link

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

@rjpkuyper
Copy link

See also: #82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants