I have two applications: Core and Chat. The Core application has common modules, including authentication. And chat, which have WebSocket implementations.
For security purposes, I want to use JwtAuthGuard on WebSocket handlers. To achieve this, I imported the AuthModule in ChatModule, as shown in the first screenshot. However, I'm receiving an error.
2024-02-05T22:22:39.288Z info: Starting Nest application...
2024-02-05T22:22:39.312Z info: PassportModule dependencies initialized
2024-02-05T22:22:39.314Z error: Nest can't resolve dependencies of the UserEntityRepository (?). Please make sure that the argument DataSource at index [0] is available in the TypeOrmModule context.
Potential solutions:
- Is TypeOrmModule a valid NestJS module?
- If DataSource is a provider, is it part of the current TypeOrmModule?
- If DataSource is exported from a separate @Module, is that module imported within TypeOrmModule?
@Module({
imports: [ /* the Module containing DataSource */ ]
})