Skip to content

Getting error Class '*' used before its declaration. ts(2449) - for class decorators #57766

@Avivbens

Description

@Avivbens

🔎 Search Terms

used before its declaration. ts(2449)
Class decorators having issues to contain the class namespace

🕗 Version & Regression Information

  • This is a crash
  • This changed between versions 5.4.2 (not exists) and 5.5.0-dev.20240312 (exists)

5.4.2

CleanShot 2024-03-13 at 21 57 01@2x

5.5.0-dev.20240312

CleanShot 2024-03-13 at 21 56 43@2x

⏯ Playground Link

No response

💻 Code

@Injectable()
export class CacheService {
  constructor(
    @Inject(REDIS_CLIENT) private readonly cache: IRedisClient,
    //  Getting the error for the following line
    @LoggerNamespace(CacheService.name) private readonly logger: Logger,
  ) {}

  /**
}

🙁 Actual behavior

Getting this error:

Class 'CacheService' used before its declaration.ts(2449)
cache.service.ts(8, 14): 'CacheService' is declared here.

🙂 Expected behavior

No errors should be presented.

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions