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 compilation fails due to missing type definitions

See original GitHub issue

This is a carry on from pact-foundation/pact-js#142

Software versions

  • OS: Ubuntu 16.04.3 LTS
  • Consumer Pact library: PactJS 5.3.1
  • Node Version: v6.9.1

Expected behaviour

When using pact-js as a devDependency, pact-js can be compiled by TypeScript successfully without requiring additional definitions (e.g. adding @types/bunyan as an explicit dependency).

Actual behaviour

TypeScript compilation fails.

Steps to reproduce

  1. Clone/Download https://gist.github.com/zsims/904dcb7d7fcc2543776740be65b171c0
  2. yarn install (or npm install)
  3. yarn test (or npm test)

Relevant log files

$ yarn run test
yarn run v1.3.2
$ tsc
node_modules/@pact-foundation/pact-node/src/logger.ts(11,8): error TS2339: Property 'info' does not exist on type 'Logger'.
node_modules/@pact-foundation/pact-node/src/logger.ts(19,36): error TS2339: Property 'level' does not exist on type 'Logger'.
node_modules/@pact-foundation/pact-node/src/logger.ts(25,16): error TS2554: Expected 0 arguments, but got 1.
node_modules/@pact-foundation/pact-node/src/publisher.ts(10,3): error TS2322: Type '{}' is not assignable to type 'PublisherOptions'.
  Property 'pactFilesOrDirs' is missing in type '{}'.
error Command failed with exit code 2.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mefellowscommented, Jan 11, 2018

Running a release for this now @zsims. v5.3.2 should be out in the next hour or so.

1reaction
zsimscommented, Jan 10, 2018

@mboudreau Can confirm this package works fine under TypeScript. But, a new release is needed for pact-foundation/pact-js due to the fixes that recently landed regarding es6-promise.

I can confirm that master of this repo and master of pact-foundation/pact-js work well from TypeScript 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript compilation fails due to missing type definitions #69
When using pact-js as a devDependency , pact-js can be compiled by TypeScript successfully without requiring additional definitions (e.g. adding ...
Read more >
How to include missing type definition files in typescript ...
I would suggest switching to types from typeRoots and using an include pattern rather than files . { "compilerOptions": { "lib": ["dom" ...
Read more >
A Complete Guide to Using TypeScript in Node.js - Better Stack
Integrating TypeScript with the NPM ecosystem. Executing TypeScript source files directly without compilation. Fixing errors caused by missing types.
Read more >
Typescript Type System: How Does it Really Work? Type ...
So as we can see in the error message, the two types are not compatible because of a missing property, and not because...
Read more >
Grumbling on TypeScript - stafford williams
Grumbling on TypeScript · Missing Type Definitions won't slow me down# · TSX breaks Generic Arrow functions# · Whacky type inference on Generics...
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