I just create a new app with npx @nestjs/cli new that has the following src/app.service.ts:
import { Injectable } from '@nestjs/common';
import { ClsService, ClsStore } from 'nestjs-cls';
interface ClsStoreFoo extends ClsStore {
foo: string;
bar: AbortController; // If I drop this line, it works
}
@Injectable()
export class AppService {
constructor(
private readonly cls: ClsService<ClsStoreFoo>,
) {}
getHello(): string {
return this.cls.set('foo', '');
}
}
src/app.service.ts:16:5 - error TS2589: Type instantiation is excessively deep and possibly infinite.
16 this.cls.set('foo', '');
~~~~~~~~~~~~~~~~~~~~~~~
When the store has some entry with the type AbortController, I got that a tsc error on ClsService#get and ClsService#set
I just create a new app with
npx @nestjs/cli new
that has the followingsrc/app.service.ts
:When the store has some entry with the type AbortController, I got that a tsc error on
ClsService#get
andClsService#set
typescript
: v4.7 & v4.8.4nestjs-cls
: v3.0.3