You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a new Nx-based NestJS library and used the ConfigService from @nestjs/config. The ConfigModule is imported in the library, and the ConfigService is injected into one of the services. However, when I use this service in a consuming NestJS app, I encounter the following error:
[Nest] 21784 - 12/01/2024, 7:33:51 AM ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'get')
TypeError: Cannot read properties of undefined (reading 'get')
at EnvService.getServerEnv (/Users/ziyadev/Desktop/repos/fannaq/dist/apps/testing/webpack:/packages/env/src/nestjs/env.service.ts:12:38)
This indicates that ConfigService is not properly injected, even though ConfigModule has been imported both in the library and as a global module in the app.
Expected Behavior
The ConfigService should be correctly injected into the library service, and configuration values should be accessible without errors.
Current Behavior
I created a new Nx-based NestJS library and used the ConfigService from @nestjs/config. The ConfigModule is imported in the library, and the ConfigService is injected into one of the services. However, when I use this service in a consuming NestJS app, I encounter the following error:
This indicates that ConfigService is not properly injected, even though ConfigModule has been imported both in the library and as a global module in the app.
Expected Behavior
The ConfigService should be correctly injected into the library service, and configuration values should be accessible without errors.
GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: