Type incompatibility after upgrading pino to 8.6.0
See original GitHub issueUpgraded pino to latest release, 8.6.0 in a project using Next.js, pino, and pino-http.
A test that assigns the log
field on a NextApiRequest
as part of its setup now fails with the following error:
Type 'Logger<LoggerOptions | DestinationStream>' is not assignable to type 'LoggerExtras<LoggerOptions>'
I tried to use a mock instead and still encountered the error.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Issues · pinojs/pino-http - GitHub
Type incompatibility after upgrading pino to 8.6.0. #247 opened on Sep 20 by thomas-yaa · 5 · Incorrect types for exported stdSerializers bug...
Read more >Blood Type Incompatibility, Rh Incompatibility, and Jaundice
It occurs when the mother is type O and the baby is A, B, or AB. As with Rh incompatibility, this means that...
Read more >Rh incompatibility: MedlinePlus Medical Encyclopedia
Rh incompatibility is a condition that develops when a pregnant woman has Rh-negative blood and the baby in her womb has Rh-positive blood....
Read more >Rh Incompatibility: Symptoms, Diagnosis & Treatments
If an incompatibility exist, it can be treated. ... A positive or negative symbol after your blood type indicates your Rh factor. For...
Read more >Rh Incompatibility During Pregnancy (for Parents) - Kids Health
This basic test determines your blood type and Rh factor, which may play an ... When a mother-to-be and father-to-be are not both...
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 Free
Top 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
I’m on the latest version of typescript (4.8.4) and I’m still experiencing the same issue. I’m trying to pass an existing pino logger instance to pino-http and I get the same error. Here is a simple example:
Casting the logger to
any
and then passing it to the logger option works as a temporary workaround.Hey @mcollina
I’ve noticed the similar behavior after upgrading to latest
pino
andpino-http
, not sure if the usage is incorrect, but after upgrading such code no longer works. (pino.Logger and resulting type fromreq.log.child
can not casted to same type)And then the error looks like this:
TS2322: Type 'Logger<LoggerOptions & ChildLoggerOptions>' is not assignable to type 'Logger<LoggerOptions> | null'. Type 'Logger<LoggerOptions & ChildLoggerOptions>' is not assignable to type 'Logger<LoggerOptions>'. Property 'onChild' is missing in type 'BaseLogger & LoggerExtras<LoggerOptions & ChildLoggerOptions> & Record<never, LogFn>' but required in type 'LoggerExtras<LoggerOptions>'.
Previously it was possible to use
pino.Logger
and child logger fromreq.log.child
as a same type. Maybe it’s an issue ofpino
though.Is this example enough?