Yarn error
bizkut opened this issue · 3 comments
Hi, I got this error when running yarn.
$ sudo yarn bot
yarn run v1.22.17
$ hardhat run --network kcc bot/index.ts
Creating Typechain artifacts in directory typechain for target ethers-v5
Successfully generated Typechain artifacts!
/home/hab/kcc-flashswap-arb/node_modules/ts-node/src/index.ts:828
return new TSError(diagnosticText, diagnosticCodes);
^
TSError: ⨯ Unable to compile TypeScript:
bot/index.ts:63:13 - error TS2571: Object is of type 'unknown'.
63 if (err.message === 'Too much pending tasks' || err.message === 'async-lock timed out') {
~~~
bot/index.ts:63:57 - error TS2571: Object is of type 'unknown'.
63 if (err.message === 'Too much pending tasks' || err.message === 'async-lock timed out') {
~~~
at createTSError (/home/hab/kcc-flashswap-arb/node_modules/ts-node/src/index.ts:828:12)
at reportTSError (/home/hab/kcc-flashswap-arb/node_modules/ts-node/src/index.ts:832:19)
at getOutput (/home/hab/kcc-flashswap-arb/node_modules/ts-node/src/index.ts:1022:36)
at Object.compile (/home/hab/kcc-flashswap-arb/node_modules/ts-node/src/index.ts:1326:43)
at Module.m._compile (/home/hab/kcc-flashswap-arb/node_modules/ts-node/src/index.ts:1458:30)
at Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Object.require.extensions.<computed> [as .ts] (/home/hab/kcc-flashswap-arb/node_modules/ts-node/src/index.ts:1462:12)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12) {
diagnosticCodes: [ 2571, 2571 ]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Hi, I got this error when running yarn.
$ sudo yarn bot yarn run v1.22.17 $ hardhat run --network kcc bot/index.ts Creating Typechain artifacts in directory typechain for target ethers-v5 Successfully generated Typechain artifacts! /home/hab/kcc-flashswap-arb/node_modules/ts-node/src/index.ts:828 return new TSError(diagnosticText, diagnosticCodes); ^ TSError: ⨯ Unable to compile TypeScript: bot/index.ts:63:13 - error TS2571: Object is of type 'unknown'.
63 if (err.message === 'Too much pending tasks' || err.message === 'async-lock timed out') { ~~~ bot/index.ts:63:57 - error TS2571: Object is of type 'unknown'.
63 if (err.message === 'Too much pending tasks' || err.message === 'async-lock timed out') { ~~~
at createTSError (/home/hab/kcc-flashswap-arb/node_modules/ts-node/src/index.ts:828:12) at reportTSError (/home/hab/kcc-flashswap-arb/node_modules/ts-node/src/index.ts:832:19) at getOutput (/home/hab/kcc-flashswap-arb/node_modules/ts-node/src/index.ts:1022:36) at Object.compile (/home/hab/kcc-flashswap-arb/node_modules/ts-node/src/index.ts:1326:43) at Module.m._compile (/home/hab/kcc-flashswap-arb/node_modules/ts-node/src/index.ts:1458:30) at Module._extensions..js (internal/modules/cjs/loader.js:1114:10) at Object.require.extensions.<computed> [as .ts] (/home/hab/kcc-flashswap-arb/node_modules/ts-node/src/index.ts:1462:12) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:12) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12) {
diagnosticCodes: [ 2571, 2571 ] } error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
In tsconfig.json under compilerOptions
add "useUnknownInCatchVariables": false,
The solution solved the issue. Thank you.
Resolved. Closed.