threefoldtech / test_feedback

Apache License 2.0
3 stars 0 forks source link

grid3_client ts version typescript problems #338

Closed LennertDefauw1 closed 1 year ago

LennertDefauw1 commented 1 year ago
@polkadot/util-crypto has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or dedupe using your package manager.
The following conflicting packages were found:
        cjs 10.1.14     node_modules/@polkadot/keyring/node_modules/@polkadot/util-crypto/cjs
        cjs 10.1.14     node_modules/grid3_client/node_modules/@polkadot/util-crypto/cjs
@polkadot/util-crypto has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or dedupe using your package manager.
The following conflicting packages were found:
        cjs 10.1.14     node_modules/@polkadot/keyring/node_modules/@polkadot/util-crypto/cjs
        cjs 10.1.14     node_modules/grid3_client/node_modules/@polkadot/util-crypto/cjs
        cjs 10.1.14     node_modules/@polkadot/types/node_modules/@polkadot/util-crypto/cjs
@polkadot/util has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or dedupe using your package manager.
The following conflicting packages were found:
        cjs 10.1.14     node_modules/@polkadot/util/cjs
        cjs 9.7.2       node_modules/ts-rmb-http-client/node_modules/@polkadot/util/cjs
@polkadot/keyring has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or dedupe using your package manager.
The following conflicting packages were found:
        cjs 10.1.14     node_modules/@polkadot/keyring/cjs
        cjs 9.7.2       node_modules/ts-rmb-http-client/node_modules/@polkadot/keyring/cjs
@polkadot/util-crypto has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or dedupe using your package manager.
The following conflicting packages were found:
        cjs 10.1.14     node_modules/@polkadot/keyring/node_modules/@polkadot/util-crypto/cjs
        cjs 10.1.14     node_modules/grid3_client/node_modules/@polkadot/util-crypto/cjs
        cjs 10.1.14     node_modules/@polkadot/types/node_modules/@polkadot/util-crypto/cjs
        cjs 9.7.2       node_modules/ts-rmb-http-client/node_modules/@polkadot/util-crypto/cjs
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/node' is not defined by "exports" in /home/jimber/Documents/Threefold/tf-deployer/node_modules/grid3_client/package.json
    at new NodeError (node:internal/errors:387:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:464:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:748:3)
    at resolveExports (node:internal/modules/cjs/loader:493:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:533:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:942:27)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/home/jimber/Documents/Threefold/tf-deployer/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
    at Function.Module._load (node:internal/modules/cjs/loader:804:27)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

this is my package.json:

{
  "scripts": {
    "deploy:qsfs": "ts-node qsfs/qsfs.deploy.ts",
    "deploy": "ts-node deploy/vm.deploy.ts",
    "delete-gateways": "ts-node delete/gateway.delete.ts",
    "delete-contracts": "ts-node delete/contract.delete.ts"
  },
  "main": "deploy/vm.deploy.ts",
  "dependencies": {
    "@polkadot/wasm-crypto": "^6.3.1",
    "dotenv": "^16.0.2",
    "grid3_client": "1.4.2",
    "tfgrid-api-client": "^1.12.1",
    "ts-node": "^10.9.1",
    "typescript": "^4.8.2"
  }
}
LennertDefauw1 commented 1 year ago

issue linked to correct repo: https://github.com/threefoldtech/grid3_client_ts/issues/464

0oM4R commented 1 year ago

in this line you need to remove /dist/node and just be grid3_client so the line should be : import { BackendStorageType, GridClient, KeypairType } from "grid3_client";

A-Harby commented 1 year ago

Verified. I changed line as in @0oM4R comment, and the error gone, and code started validating user variables.

in this line you need to remove /dist/node and just be grid3_client so the line should be : import { BackendStorageType, GridClient, KeypairType } from "grid3_client";