Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Error "Cannot read property 'UriResolver' of undefined" in v2.4 #1061

Closed
hickscorp opened this issue Jun 29, 2019 · 6 comments
Closed

Error "Cannot read property 'UriResolver' of undefined" in v2.4 #1061

hickscorp opened this issue Jun 29, 2019 · 6 comments
Labels

Comments

@hickscorp
Copy link

hickscorp commented Jun 29, 2019

We've updated our dependencies and all of a sudden ZOS starts to fail, even when called without any arguments:

zos                   
/home/doodloo/.config/yarn/global/node_modules/@resolver-engine/imports-fs/build/index.js:16
    UriResolver: core_1.resolvers.UriResolver,
                                  ^

TypeError: Cannot read property 'UriResolver' of undefined
    at Object.<anonymous> (/home/doodloo/.config/yarn/global/node_modules/@resolver-engine/imports-fs/build/index.js:16:35)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/home/doodloo/.config/yarn/global/node_modules/zos/lib/models/compiler/solidity/SolidityProjectCompiler.js:24:22)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/home/doodloo/.config/yarn/global/node_modules/zos/lib/models/compiler/Compiler.js:17:35)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/home/doodloo/.config/yarn/global/node_modules/zos/lib/commands/push.js:20:20)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)

Doing a bit of research showed another project (cryptopunkers) with the same error - given who handled the issue, I'm wondering whether a bad dependency made its way into ZOS ;)

As I'm not sure what exactly got broken, a hint on what dependencies to force would be great until resolution!

@jbcarpanelli
Copy link
Contributor

Hello @hickscorp! Sadly, this issue was introduced after releasing v2.4. We are already tracking it in #1046, and we have already pushed a fix in #1059 which we will release early this week.
I can provide you two solutions in the meantime:

  • Install zos globally using npm

or

  • Install zos locally, but using npm instead of using yarn.

@spalladino spalladino changed the title Error with recent ZOS. Error "Cannot read property 'UriResolver' of undefined" in v2.4 Jul 1, 2019
@spalladino
Copy link
Contributor

Hey @hickscorp, this issue has been fixed in 2.4.1. I'm closing it, but please comment if you stumble upon it again. Thanks for the report!

@hickscorp
Copy link
Author

@spalladino This issue might be closed now, but a new one surfaced. Should I open a new issue?

$ /whatever/node_modules/.bin/zos push --verbose --network cv_dev --skip-compile
[2019-07-17T11:36:[email protected]#getOptions] <started> Using session with network cv_dev, sender address 0x717634cfe06FFAB2CEAA7fcf1b9019813f4B25FE, timeout 30 seconds
[2019-07-17T11:36:[email protected]#_uploadSolidityLib] <started> Uploading AddressSet library
[2019-07-17T11:36:[email protected]#setImplementation] <started> Deploying logic contract for AddressSet
[2019-07-17T11:36:[email protected]#call] <started> TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
    at validateString (internal/validators.js:125:11)
    at Object.basename (path.js:1289:5)
    at Object._log (/whatever/node_modules/zos-lib/src/utils/Logger.ts:126:32)
    at Object.succeed (/whatever/node_modules/zos-lib/src/utils/Logger.ts:101:10)
    at NetworkController.<anonymous> (/whatever/node_modules/zos/src/models/network/NetworkController.ts:277:11)
    at Generator.next (<anonymous>)
    at fulfilled (/whatever/node_modules/zos/lib/models/network/NetworkController.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)
[2019-07-17T11:36:[email protected]#write] <started> Updated zos.dev-18021981.json
error Command failed with exit code 1.

@spalladino
Copy link
Contributor

@hickscorp no need, already reproduced it. Expect a new patch soon!

@spalladino
Copy link
Contributor

@hickscorp actually, I have a hunch that the error may only happen in verbose mode. Could you check removing the --verbose flag?

@hickscorp
Copy link
Author

hickscorp commented Jul 20, 2019

Unfortunatelly our tooling changed too much (We've been a bit lost between the @openzepelin/... packages and old zos / zos-lib and messed up our yarn.lock file). Be sure that I'll post back if we can reproduce it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants