TypeScript errors due to usage of bunyan dependency types
See original GitHub issue@pact-foundation/pact-node version: 6.19.11 bunyan version: 1.8.12 @types/bunyan version: 1.8.2
The usage of the bunyan dependency seems incorrect in logger.ts.
TypeScript complains that Type 'typeof Logger' is not a constructor function type.
in logger.d.ts from the compiled module. The fix seems to be
/// <reference types="bunyan" />
import * as bunyan from "bunyan";
-export declare class Logger extends bunyan {
+export declare class Logger extends bunyan.default {
time(action: string, startTime: number): void;
readonly logLevelName: string;
}
For now, I’m including the following code to fix this type issue locally
declare module 'bunyan'
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
TypeScript errors due to usage of bunyan dependency types
The usage of the bunyan dependency seems incorrect in logger.ts. TypeScript complains that Type 'typeof Logger' is not a constructor function ...
Read more >node.js - Logging in Typescript using Bunyan and Logentries
I want to setup remote Logging using logentries.com in my ionic app. This an extract from my package.json : "dependencies": { "bunyan": " ......
Read more >bunyan - npm
Used for serializing JavaScript error objects, including traversing an error's cause chain for error objects with a .cause() -- e.g. as from verror....
Read more >Understanding the dependency inversion principle in TypeScript
Learn to implement the dependency inversion principle in your TypeScript projects for flexible, clean applications.
Read more >bunyan-gcp-logging - npm Package Health Analysis - Snyk
Bunyan Transport for GCP (Google Cloud Platform) using Cloud Logging For more information about how to use this package see README.
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
pact-node 6.20.1 is going out as we speak with the fixes (removing @types/bunyan). Please update to this version and let me know if this works for you. Cheers.
@samuelmaddock @Byron-TW What version of TS are you using?