[BUG] TypeError: (0 , pino_http_1.pinoHttp) is not a function
See original GitHub issue[x] I’ve read the docs of nestjs-pino
[x] I’ve read the docs of pino
[x] I couldn’t find the same open issue of nestjs-pino
What is the current behavior?
After upgrading to version 2.4.0, I get the following error when starting a nestjs project that was using nestjs-pino
version 2.3.1 without issues.
/home/user/project/node_modules/nestjs-pino/LoggerModule.js:94
const middleware = (0, pino_http_1.pinoHttp)(params);
^
TypeError: (0 , pino_http_1.pinoHttp) is not a function
at createLoggerMiddlewares (/home/user/project/node_modules/nestjs-pino/LoggerModule.js:94:49)
at LoggerModule.configure (/home/user/project/node_modules/nestjs-pino/LoggerModule.js:64:29)
at MiddlewareModule.loadConfiguration (/home/user/project/node_modules/@nestjs/core/middleware/middleware-module.js:49:24)
at loadMiddlewareConfiguration (/home/user/project/node_modules/@nestjs/core/middleware/middleware-module.js:38:24)
at Array.map (<anonymous>)
at MiddlewareModule.resolveMiddleware (/home/user/project/node_modules/@nestjs/core/middleware/middleware-module.js:41:41)
at MiddlewareModule.register (/home/user/project/node_modules/@nestjs/core/middleware/middleware-module.js:33:20)
at NestApplication.registerModules (/home/user/project/node_modules/@nestjs/core/nest-application.js:80:37)
at NestApplication.init (/home/user/project/node_modules/@nestjs/core/nest-application.js:94:20)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
What is the expected behavior? The Nestjs project should start normally. No issues in previous version 2.3.1
Please provide minimal example repo. Without it this issue will be closed
No time to provide a repo to reproduce. If this issue will be closed, I will just stick to 2.3.1. The issue should be easy to reproduce, however, as all you have to do if to only follow the Readme
of this repo.
Please mention other relevant information such as Node.js version and Operating System. Node v16.13.0 Ubuntu 20.04 LTS under WSL 2
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top GitHub Comments
Had the same error today on Docker with node:14.16.0.
I solved it by updating the version of
"nestjs-pino": "^2.2.0", -> "^2.4.0"
and"pino-http": "^5.8.0", -> "^6.5.0"
in the package.json.Thanks @Loubis!
"pino-http": "^6.5.0"
works just fine with"nestjs-pino": "^2.2.0"
as well. pino-http was missing the required Type.