Skip to content
Advertisement

In the next major version, Nest will not allow classes annotated with @Injectable(), @Catch(), and @Controller() decorators

I’m writing in Nest.js framework for 3 years and i got the message in by backend-application:

WARN [DependenciesScanner] In the next major version, Nest will not allow classes annotated with @Injectable(), @Catch(), and @Controller() decorators to appear in the "imports" array of a module.
Please remove "ExternalOrAdmin" (including forwarded occurrences, if any) from all of the "imports" arrays.

Scope [BackendAdminModule -> LicenseModule -> AuthModule]

I researched nest.js github and stuck what is the problem and why it says about some deprecation of useable decorators.

Does anyone know how to solve this problem or what will be in the next major version of Nest.js framework

Thanks in advance!

Advertisement

Answer

only modules should be listed in the imports array. That’s why this wrong usage won’t be allowed in v9 anymore.

Read the docs on modules: https://docs.nestjs.com/modules

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement