[`PINO` BUG] wrong export of types in `pino` package
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?
When skipLibCheck
is disabled in tsconfig.json
compilation fails.
node_modules/nestjs-pino/params.d.ts:3:10 - error TS2614: Module '"pino"' has no exported member 'DestinationStream'. Did you mean to use 'import DestinationStream from "pino"' instead?
3 import { DestinationStream } from 'pino';
~~~~~~~~~~~~~~~~~
node_modules/nestjs-pino/params.d.ts:6:18 - error TS2694: Namespace '"/nestjs-pino-bug/node_modules/pino/pino"' has no exported member 'Logger'.
6 logger: pino.Logger;
~~~~~~
node_modules/nestjs-pino/params.d.ts:13:25 - error TS2694: Namespace '"/nestjs-pino-bug/node_modules/pino-http/index"' has no exported member 'Options'.
13 pinoHttp?: pinoHttp.Options | DestinationStream | [pinoHttp.Options, DestinationStream];
~~~~~~~
node_modules/nestjs-pino/params.d.ts:13:65 - error TS2694: Namespace '"/nestjs-pino-bug/node_modules/pino-http/index"' has no exported member 'Options'.
13 pinoHttp?: pinoHttp.Options | DestinationStream | [pinoHttp.Options, DestinationStream];
~~~~~~~
node_modules/nestjs-pino/PinoLogger.d.ts:3:38 - error TS2694: Namespace '"/nestjs-pino-bug/node_modules/pino/pino"' has no exported member 'BaseLogger'.
3 declare type PinoMethods = Pick<pino.BaseLogger, 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'>;
~~~~~~~~~~
node_modules/nestjs-pino/PinoLogger.d.ts:11:32 - error TS2694: Namespace '"/nestjs-pino-bug/node_modules/pino/pino"' has no exported member 'Logger'.
11 static readonly root: pino.Logger;
~~~~~~
node_modules/nestjs-pino/PinoLogger.d.ts:29:24 - error TS2694: Namespace '"/nestjs-pino-bug/node_modules/pino/pino"' has no exported member 'Logger'.
29 get logger(): pino.Logger;
~~~~~~
node_modules/nestjs-pino/PinoLogger.d.ts:30:25 - error TS2694: Namespace '"/nestjs-pino-bug/node_modules/pino/pino"' has no exported member 'Bindings'.
30 assign(fields: pino.Bindings): void;
What is the expected behavior?
Library should work independently from skipLibCheck
config flag.
Please provide minimal example repo. Without it this issue will be closed https://github.com/antspk/nestjs-pino-bug
Please mention other relevant information such as Node.js version and Operating System. node v16.13.0 macos 12.0.1
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:10 (7 by maintainers)
Top Results From Across the Web
New bundled TypeScript typings do not expose various top ...
As I commented in #910, the bundled TypeScript type definitions do not allow import ... [ PINO BUG] wrong export of types in...
Read more >A Complete Guide to Pino Logging in Node.js - Better Stack
This code requires the pino package and exports a pino() function that takes two optional arguments, options and destination , and returns a ......
Read more >Node.js logging best practices: The essential guide
Logging using Node.js can save hours of debugging work. Here are logging best practices and our recommendations for the best logging tools.
Read more >@types/pino - npm
Start using @types/pino in your project by running `npm i @types/pino`. There are 309 other projects in ... This package has been deprecated....
Read more >Re-export third party definitions in typescript npm module
I think the answer is to include @types/pino as a dependency in the package.json of the module, so it's installed alongside the logging ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
finally, all the types are fixed in v2.4.0. Big thanks to @jarcodallo . Unpinning this issue
OK, so pino-team had decided to move the types from
@types/pino
to the lib’s.d.ts
file. Without backward compatibilitySubscribe to this issue and switch
skipLibCheck
until it’s fixed.As this is not a bug of the current library I’m closing, but will pin it until it’s fixed.