#Dependencies error

11 messages · Page 1 of 1 (latest)

gray needle
#

Hi everyone
Anyone can help me to figure out this error on the screenshot please?

@Injectable()
export class UsersService {
  constructor(
    private prisma: PrismaService,
    private bcrypt: Bcrypt,
  ) {}

I'm using this on my constructor, and for the error disappear I need to remove all these dependencies.
On my module:

@Module({
  controllers: [UsersController],
  providers: [Bcrypt, JwtAuthGuard, JwtService, UsersService],
  exports: [UsersService],
})
export class UsersModule {}

The Prisma service I put it globally and import it on app.module.ts:

@Global()
@Module({
  providers: [PrismaService],
  exports: [PrismaService],
})
export class PrismaModule {}
#

This is my app.module.ts:

@Module({
  imports: [
    ConfigModule.forRoot({
      isGlobal: true,
      load: [authConfig, appConfig],
    }),
    PrismaModule,

    AuthModule,
    UsersModule,
    CustomersModule,
  ],
  controllers: [],
  providers: [],
})
export class AppModule {}
tardy furnace
#

It looks like Bcrypt at UsersService is not a class. Please show us how did you import that

#

and make sure to read the FAQ page at nestjs docs site

gray needle
#

But if I remove the Bcrypt class and leaves the prisma the error persists

#

I comment everything on that service, the error goes for other service, I did the same on that service and the error goes for the local strategy

#

I don’t know what I’m doing wrong

vapid grove
#

it says at index [0], which is actually the Prisma dependency

#

Without more context, but based on the fact that is says Object and not the actual name of the class, I'm going to assume it's either due to circular dependencies between files, or using import type instead of just import for the dependencies.

gray needle
#

Thanks

#

I think is that