-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
needs triageThis issue has not been looked intoThis issue has not been looked into
Description
Is there an existing issue for this?
- I have searched the existing issues
Current behavior
A transient service (MyService) uses another transient service (MyLogger)
The constructor and the onModuleInit is called in the MyService
But the constructor or the onModuleInit is not called in the MyLogger
When use this.logger.error in the MyService, the logger instance is found and has error function
But the this.logger in the MyLogger is undefined
Minimum reproduction code
https://github.com/NicChoi/nestjs-transient
Steps to reproduce
- npm i
- npm start
- curl http://localhost:3000
Expected behavior
Request failure
this.logger is undefined in the MyLogger service
NestJS version
11.1.9
Packages versions
{
"name": "nestjs-transient",
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"license": "UNLICENSED",
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix"
},
"dependencies": {
"@nestjs/common": "^11.1.9",
"@nestjs/core": "^11.1.9",
"@nestjs/platform-express": "^11.1.9",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.2"
},
"devDependencies": {
"@eslint/eslintrc": "^3.3.3",
"@eslint/js": "^9.39.2",
"@nestjs/cli": "^11.0.14",
"@nestjs/schematics": "^11.0.9",
"@types/express": "^5.0.6",
"@types/node": "^22.19.3",
"eslint": "^9.39.2",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.4",
"globals": "^16.5.0",
"prettier": "^3.7.4",
"source-map-support": "^0.5.21",
"ts-loader": "^9.5.4",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.9.3",
"typescript-eslint": "^8.50.0"
}
}Node.js version
22.21.1
In which operating systems have you tested?
- macOS
- Windows
- Linux
Other
No response
Metadata
Metadata
Assignees
Labels
needs triageThis issue has not been looked intoThis issue has not been looked into