TypeScript compilation fails due to missing type definitions
See original GitHub issueThis 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
- Clone/Download https://gist.github.com/zsims/904dcb7d7fcc2543776740be65b171c0
yarn install
(ornpm install
)yarn test
(ornpm 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:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top 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 >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
Running a release for this now @zsims.
v5.3.2
should be out in the next hour or so.@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 regardinges6-promise
.I can confirm that master of this repo and master of
pact-foundation/pact-js
work well from TypeScript 😄