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.

Typecheck is failling in your truffle-v5 example

See original GitHub issue

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 --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:closed
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
EctoplasmFantomcommented, Jun 19, 2021

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.

0reactions
krzkaczorcommented, Jun 23, 2021

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.

Read more comments on GitHub >

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

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