AcalaNetwork / chopsticks

Create parallel reality of your Substrate network.
Apache License 2.0
138 stars 84 forks source link

need to check deps #533

Closed xlc closed 1 year ago

xlc commented 1 year ago

when using yarn pnp mode

Error: @acala-network/chopsticks-testing tried to access @polkadot/api, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: @polkadot/api (via "@polkadot/api/package.json")
Required by: @acala-network/chopsticks-testing@virtual:70704e6eea4b5d869b5896fced41adec073414a73dad3948e2196ef6ff01acf270932fb0d9545921d5a8db704b2504f6ecceb9773af15a465a9f36085d8681a6#npm:0.9.2-2 (via /Users/xiliangchen/projects/acala/chopsticks-ksm-xcm/.yarn/__virtual__/@acala-network-chopsticks-testing-virtual-7c083d410a/0/cache/@acala-network-chopsticks-testing-npm-0.9.2-2-eb17420269-aa7bc01338.zip/node_modules/@acala-network/chopsticks-testing/dist/esm/index.js)

 ❯ makeError .pnp.cjs:13400:34
 ❯ resolveToUnqualified .pnp.cjs:15120:21
 ❯ Object.resolveToUnqualified .pnp.cjs:15302:26
 ❯ resolve$1 .pnp.loader.mjs:1981:31

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 'MODULE_NOT_FOUND', pnpCode: 'UNDECLARED_DEPENDENCY', data: { request: '@polkadot/api/package.json', issuer: '/Users/xiliangchen/projects/acala/chopsticks-ksm-xcm/.yarn/__virtual__/@acala-network-chopsticks-testing-virtual-7c083d410a/0/cache/@acala-network-chopsticks-testing-npm-0.9.2-2-eb17420269-aa7bc01338.zip/node_modules/@acala-network/chopsticks-testing/dist/esm/index.js', issuerLocator: { name: '@acala-network/chopsticks-testing', reference: 'virtual:70704e6eea4b5d869b5896fced41adec073414a73dad3948e2196ef6ff01acf270932fb0d9545921d5a8db704b2504f6ecceb9773af15a465a9f36085d8681a6#npm:0.9.2-2' }, dependencyName: '@polkadot/api' } }
qiweiii commented 1 year ago

is this the only error? we also import other packages like @polkadot/util* @polkadot/types not declared in package.json, we can add all of them if it's the best practice

qiweiii commented 1 year ago

https://classic.yarnpkg.com/lang/en/docs/pnp/troubleshooting/#toc-is-trying-to-require-without-it-being-listed-in-its-dependencies

xlc commented 1 year ago

it stops at first error but I am sure there will be more once we fixed this one