Issue encountered with Nest InjectRedis and TypeScript version 5.1.6 incompatibility

Recently, I made an update to my NestJs project by upgrading the TypeScript version from 4.9.5 to 5.1.6. However, after this update, I encountered an issue with @InjectRedis not working as expected.

Here is a snippet of the code causing the problem:

@Injectable() export class MyService { constructor( @InjectRedis('REDIS') private readonly redisService: Redis, ) {} ... }

The error message that pops up says: "Unable to resolve signature of parameter decorator when called as an expression.
Argument of type 'undefined' is not assignable to parameter of type 'string | symbol'."

If anyone has any suggestions on how to troubleshoot and resolve this issue, please share your insights as I am currently stuck and unsure where to begin looking for a solution.

Answer №1

Despite my efforts, I have yet to discover a straightforward solution for this problem. To document my findings, I've logged an issue on GitHub here.

As a temporary fix, you might want to consider using @(InjectRedis as any)('REDIS') instead of @InjectRedis('REDIS').

Answer №2

The issue has been resolved in version @nestjs/common v9.3.0

Ensure that you are utilizing the most up-to-date versions of all your @nestjs/* packages, particularly within NestJS v9.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

switching the content of a button when it is clicked

I am currently using Angular 7 and I am trying to achieve a functionality where the text on a button changes every time it is clicked, toggling between 'login' and 'logout'. Below is the code snippet I have been working on: typescript ...

Using Typescript to typecast in D3.js

Utilizing the D3 graph example available here. I've defined my data object as shown below: interface ID3Data { age: string, population: number } const data: ID3Data[] = [ { age: "<5", population: 2704659 }, { age: "5-13", population: 4499 ...

how can I retrieve only the child route in next js?

Need help with this title. This is my Next JS project and I am working on a custom breadcrumb component. Everything seems to be going well so far, but I am facing an issue with the /people page followed by the /people/roles page. I want to extract only the ...

How can you personalize the dropdown button in dx-toolbar using DevExtreme?

Currently, I am working with the DevExtreme(v20.1.4) toolbar component within Angular(v8.2.14). However, when implementing a dx-toolbar and specifying locateInMenu="always" for the toolbar items, a dropdown button featuring the dx-icon-overflow i ...

Encountering a snag while setting up Google authentication on my website

Currently, I am in the process of integrating Google Authentication into my website. However, I have run into an error related to session management that reads as follows: TypeError: req.session.regenerate is not a function at SessionManager.logIn (C:&bso ...

Is there a way to implement depth-first retrieval in rxjs using the expand method?

Currently, I am engaged in a project utilizing Angular 7, Typescript, and RxJS 6.3.3. In this project, I am working with RxJS Observables and relevant operators to handle hierarchical collections of objects obtained from an http server that interfaces with ...

What is the process for adding my Ionic app to the share menu on an iPhone?

I'm working on an Ionic 3 app and I want it to be integrated into the iPhone share list just like shown in this example, https://i.sstatic.net/U2Lqr.png The Share option should appear when users access the gallery and then when they press the share b ...

What is the best way to determine which function to invoke in ngIf?

Depending on the value of a variable, I need to call either the login() or logout() methods from this.loggedInService.isLoggedIn. If the value of the variable is !this.loggedInService.isLoggedIn, then call login(). If !this.loggedInService.isLoggedIn is ...

Angular2 - adding the authentication token to request headers

Within my Angular 2 application, I am faced with the task of authenticating every request by including a token in the header. A service has been set up to handle the creation of request headers and insertion of the token. The dilemma arises from the fact t ...

What is the process of branching a stream with highland.js?

I have a stream called sourceStream that contains objects of type BaseData. My goal is to split this stream into n different streams, each filtering and transforming the BaseData objects according to their specific criteria. Ultimately, I want to end up ...

Changing the Image Source in HTML with the Power of Angular2

Despite my efforts, I'm unable to display the updated image in my HTML file. In my TypeScript file, the imageUrl is updating as expected and I've verified this in the console. However, the HTML file is not reflecting these changes. In my researc ...

Protected class, yet not transferable

My output varies based on the type of input provided. I have a custom guard in place to protect the input, but I'm still having trouble assigning it to the declared output: type InputType<Sub extends SubType> = { a: Sub, b: string } type SubTyp ...

Issue with hydration when logging in with Next-Auth in NextJS 13.4

Step-by-step Instructions: 'node -v' -> v18.16.1 'npx -v' -> 9.8.0 To start, I created a new Next.js app by running npx create-next-app@latest in the terminal within my app folder. Here is a link to the package.json file. Nex ...

Unusual Observable behavior in Angular/Typescript leaves developers scratching their heads

I have encountered an issue with a single Angular 2 service: validate() { return this.http.get('api/validate', data); } Consuming the API works fine: this.ValidationService.validate().subscribe(result => { console.log(&a ...

What is the process for creating a standard component in React Native?

Creating a generic component is my goal, but I am unsure of how to proceed. Any advice? Model: export interface ISelectOptionsRLV<T, C> { data: T[]; onPress: (option: C[]) => void; } GenericComponentList: import { StyleSheet, Text, View, Fla ...

Exploring Manipulation of M:N Associations in Sequelize

I have set up a sequelize schema using postgre DB export const Commune = sq.define("commune",{ codeCommune: { type: DataTypes.STRING(5), allowNull: false, primaryKey: true }, libelleCommune: { type: ...

Exploring Angular 2's EventEmitter for Event Handling and Debugging

My attempt at creating a basic event emitter doesn't seem to be functioning properly. Here's the code snippet: Main Component This is the main app component I have been working on: @Component({ selector:'my-app', templateUrl: ...

Drag and Drop File Upload with Angular 2

I'm currently working on incorporating a drag and drop upload feature for angular 2, similar to the one found at: Given that I am using angular 2, my preference is to utilize typescript as opposed to jquery. After some research, I came across a libra ...

Utilizing LocalStorage with Angular 6 BehaviorSubject

I'm struggling with retaining data after refreshing a page. My approach involves using a shared service to transfer data between unrelated components. Despite extensive research on LocalStorage implementation and usage, I have not been able to find a ...

Incorporate matter-js into your TypeScript project

Upon discovering this file: https://www.npmjs.com/package/@types/matter-js I ran the following line of code: npm install --save @types/matter-js When I tried to use it in the main ts file, an error message appeared: 'Matter' refers to a U ...