Typecheck is failling in your truffle-v5 example
See original GitHub issueHello,
I just cloned your example, and:
npm i
npm run typecheck
leads to:
$ npm run typecheck
> example-truffle-v5@0.0.1 typecheck
> tsc --noEmit
types/truffle-contracts/index.d.ts:4:9 - error TS2669: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations.
4 declare global {
~~~~~~
types/truffle-contracts/types.d.ts:17:34 - error TS2694: Namespace 'Truffle' has no exported member 'Artifacts'.
17 declare const artifacts: Truffle.Artifacts;
~~~~~~~~~
Found 2 errors.
npm ERR! code 2
npm ERR! path E:\projects\js\truffle-v5
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c tsc --noEmit
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\bbern\AppData\Local\npm-cache\_logs\2021-05-16T22_52_45_541Z-debug.log
Did I miss a step or do something wrong? Thanks in advance.
Specs: Windows 10 64bits v1909 ; npm v7.5.4
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Typecheck is failling in your truffle-v5 example #385 - GitHub
Hello, I just cloned your example, and: npm i npm run typecheck leads to: $ npm run typecheck > example-truffle-v5@0.0.1 typecheck > tsc ......
Read more >Adding Typescript to Truffle and Buidler - Solidity developer
Learn how to use Typescript in Truffle and Buidler projects to level up your JavaScript code with typechecking including contract types.
Read more >ConsenSys/truffle - Gitter
@eggplantzzz I just upgraded to Truffle 5.0.42 and the networks command is no longer working, in the console ... you get a type...
Read more >Test your contracts - Truffle Suite
Note: When the truffle test process exits, its exit code is equal to the number of failing tests. If there are more than...
Read more >Solidity Documentation - Read the Docs
In this example, the contract defines the functions set and ... Note: Solidity versions prior to 0.5.10 can fail to correctly link against ......
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
Problem seems to be the single quotes used in the generate-types script causing typechain to match 0 files which causes various other problems, including the error you’ve seen. Changing the single quotes to double quotes allows it to match the files and the errors go away. I’m assuming this is only a problem for Windows, and that’s why this wasn’t detected in CI.
I am closing this for now as this is windows specific.
I created: https://github.com/ethereum-ts/TypeChain/issues/411 and it’s marked as help wanted :-> If you want to pick it up and add CI config for windows you have all my support. Thanks for reporting.