question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mboudreaucommented, Jan 3, 2019

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.

0reactions
mboudreaucommented, Jan 2, 2019

@samuelmaddock @Byron-TW What version of TS are you using?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found