question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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) {}
}

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:7

github_iconTop GitHub Comments

2reactions
goranjvivcommented, Jul 14, 2021
0reactions
rjpkuypercommented, Oct 7, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

NestJs can't resolve dependencies of the HeicService
I separated it into two modules redis-publish and redis-cache and still only if I cut both dependencies out of the heic.module it works...
Read more >
Common errors - FAQ - A progressive Node.js framework
"Cannot resolve dependency" error#. Probably the most common error message is about Nest not being able to resolve dependencies of a provider. The...
Read more >
please make sure that the argument cache_manager at index ...
Sign up for free ... Nest can't resolve dependencies of the (?). ... expected to not have errors and successfully get the key...
Read more >
20 Dependents - @liaoliaots/nestjs-redis - npm
Redis (ioredis) module for Nest framework (node.js).. Latest version: 9.0.4, last published: a month ago.
Read more >
Getting started with continuous integration for Nest.js APIs
js app; Writing, running, and automating tests. Nest.js is a scalable and efficient server-side Node.js framework built with TypeScript.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found