Closed briankostar closed 3 years ago
Hey Brian! I just ran the yarn clean
script and it works fine on my end:
Could you share the following information so I can investigate, please?
I have the same issue:
Hey Paul, yup this is my env:
Thanks for the extra info, guys! Looks like an issue with node v14 specifically.
I've also tried on node 14.16.0 and 15.12.0 but still same issue.
That is, node v14 and above. There must be a new behaviour that doesn't work well with my Hardhat clean task.
Looks like this is an upstream problem. Running NODE_OPTIONS="--trace-warnings" yarn run test
gave me this:
(node:14555) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency
at emitCircularRequireWarning (node:internal/modules/cjs/loader:698:11)
at Object.get (node:internal/modules/cjs/loader:712:5)
at Object.<anonymous> (/Users/paulrberg/workspace/templates/solidity-template/node_modules/prettier-plugin-solidity/node_modules/antlr4/tree/Trees.js:13:49)
at Module._compile (node:internal/modules/cjs/loader:1092:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
at Module.load (node:internal/modules/cjs/loader:972:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Module.require (node:internal/modules/cjs/loader:996:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object.<anonymous> (/Users/paulrberg/workspace/templates/solidity-template/node_modules/prettier-plugin-solidity/node_modules/antlr4/RuleContext.js:122:13)
Looks like prettier-plugin-solidity needs to patch their dependencies. I opened an issue there: https://github.com/prettier-solidity/prettier-plugin-solidity/issues/463
The good news is that the warning can be safely ignored. The bad news is that until prettier-plugin-solidity patches this, the warning will still be around in node v14 and above.
Update: prettier-plugin-solidity
is patched, but solidity-coverage
has the same problem. Will open an issue in their repo too!
(node:97946) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency
at emitCircularRequireWarning (node:internal/modules/cjs/loader:698:11)
at Object.get (node:internal/modules/cjs/loader:712:5)
at Object.<anonymous> (/Users/paulrberg/workspace/templates/solidity-template/node_modules/sc-istanbul/lib/command/help.js:9:37)
at Module._compile (node:internal/modules/cjs/loader:1092:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
at Module.load (node:internal/modules/cjs/loader:972:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Module.require (node:internal/modules/cjs/loader:996:19)
at require (node:internal/modules/cjs/helpers:92:18)
at /Users/paulrberg/workspace/templates/solidity-template/node_modules/sc-istanbul/lib/util/factory.js:56:35
(node:97946) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency
at emitCircularRequireWarning (node:internal/modules/cjs/loader:698:11)
at Object.get (node:internal/modules/cjs/loader:712:5)
at Object.<anonymous> (/Users/paulrberg/workspace/templates/solidity-template/node_modules/solidity-coverage/node_modules/@solidity-parser/parser/dist/antlr4/RuleContext.js:32:46)
at Module._compile (node:internal/modules/cjs/loader:1092:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
at Module.load (node:internal/modules/cjs/loader:972:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Module.require (node:internal/modules/cjs/loader:996:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object.<anonymous> (/Users/paulrberg/workspace/templates/solidity-template/node_modules/solidity-coverage/node_modules/@solidity-parser/parser/dist/antlr4/PredictionContext.js:10:19)
(node:97946) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency
at emitCircularRequireWarning (node:internal/modules/cjs/loader:698:11)
at Object.get (node:internal/modules/cjs/loader:712:5)
at Object.<anonymous> (/Users/paulrberg/workspace/templates/solidity-template/node_modules/solidity-coverage/node_modules/@solidity-parser/parser/dist/antlr4/tree/Trees.js:15:49)
at Module._compile (node:internal/modules/cjs/loader:1092:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
at Module.load (node:internal/modules/cjs/loader:972:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Module.require (node:internal/modules/cjs/loader:996:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object.<anonymous> (/Users/paulrberg/workspace/templates/solidity-template/node_modules/solidity-coverage/node_modules/@solidity-parser/parser/dist/antlr4/RuleContext.js:126:13)
The warning should be gone now, since commit 8244999. Thanks for the help with identifying this issue, @briankostar and @kraikov!
Awesome! I can confirm the fix. Specifically, it was the sc-istanbul 0.4.5 sub package that was the issue for me. After its upgraded to 0.4.6, warnings disappeared. Thanks for your amazing effort.
When running the scripts defined in package json (eg. yarn clean), keep running into this warning:
(node:88504) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency (Use
node --trace-warnings ...
to show where the warning was created) (node:88504) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency (node:88504) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency