1

I am receiving the following error from vscode even with the most minimal contract and tests in a fresh completium-cli project:

Argument of type 'import(\"/Users/grum/royaltiesProject/rrtwo/node_modules/
@completium/experiment-ts/node_modules/@completium/archetype-ts-types/build/src/main\").Address' is 
not assignable to parameter of type 'import(\"/Users/grum/royaltiesProject/rrtwo/node_modules/
@completium/archetype-ts-types/build/src/main\").Address' 
Types have separate declarations of a private property '_content'.

The contract:

archetype xnft(owner: address)

The test file:

import {get_account} from "@completium/experiment-ts";
import { xnft } from './binding/xnft'

const alice = get_account('alice');
const owner = alice.get_address()

describe('[xnft] Contract deployment', async () => {
  it("test deployment", async () => { 
    await xnft.deploy(alice.get_address(),{})
  }) 
})  

The test file yields the following error:

1) [xnft] Contract deployment
       test deployment:
     Error: Error: parameter "owner" not found.
      at compute_tzstorage (node_modules/@completium/completium-cli/src/main.js:1781:15)
      at Object.deploy (node_modules/@completium/completium-cli/src/main.js:2049:27)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at Object.deploy (node_modules/@completium/completium-cli/src/completium.js:40:13)

I've tried starting again with a fresh project and searched for answers online. It seems to be sometimes related to redundant dependencies, but my attempts to fix it by removing some nested dependencies resulted in other things breaking so I figured that was beyond my current skill level.

When starting a fresh project, I found I could recreate the vscode error in the default 'hello' project by adding just a few minor changes - calling await hello.deploy(alice.get_address(), { as: alice }) in the test file and changing the first line of the .arl contract to archetype hello(owner: address).

Any help is greatly appreciated.

MORE INFO: Adding my package.json file as requested by Benoit

{
  "name": "rrtwo",
  "version": "1.0.0",
  "scripts": {
    "test": "ts-mocha --timeout 0 --slow 99999999999999999 ./tests/*.ts",
    "watch-test":  "ts-mocha --timeout 0 --slow 99999999999999999 ./tests/*.ts -w --watch-files '/.contracts//*.arl , ./tests//*.ts'",
    "gen-binding": "completium-cli run binder-ts",
    "auto-gen-binding": "nodemon --watch contracts -e arl --exec completium-cli run binder-ts"
  },
  "dependencies": {
    "@completium/archetype-ts-types": "latest",
    "@completium/completium-cli": "latest",
    "@completium/experiment-ts": "latest"
  },
  "devDependencies": {
    "@types/expect": "^24.3.0",
    "@types/mocha": "^10.0.0",
    "@types/node": "latest",
    "ts-mocha": "^10.0.0",
    "typescript": "4.7.4"
  },
  "completium": {
    "binding_path": "./tests/binding/",
    "build_path": "./build/",
    "contracts_path": "./contracts/",
    "tests_path": "./tests/"
  }
}

EVEN MORE INFO:

I've had a look at package-lock.json and I've noticed that the version for archetype ts-types is 0.0.16, however the version for archetype-ts-types listed under the dependencies for experiment-ts is 0.0.14:

    "node_modules/@completium/archetype-ts-types": {
      "version": "0.0.16",
      "resolved": "https://registry.npmjs.org/@completium/archetype-ts-types/-/archetype-ts-types-0.0.16.tgz",
      "integrity": "sha512-KGIX3UE8sHk6AyrJaRbVZ/Pdk5Go0J9Yi4eE9EfqG2Hbdd3tfTqySspdMbynymPrdjX6/ub7k4NjVdprt5HcSg==",
      "dependencies": {
        "bignumber.js": "^9.0.2",
        "bs58check": "^2.1.2"
      }

...later in the file...

    "node_modules/@completium/experiment-ts": {
      "version": "0.0.102",
      "resolved": "https://registry.npmjs.org/@completium/experiment-ts/-/experiment-ts-0.0.102.tgz",
      "integrity": "sha512-wCcJUSqR1+UCrkmsBrYWPIMu/MZdRgGREwpm3ztTqWN+7r+diANoOVwwCR0IK+2IXTV5eVYf3aUJDBp8oG0FmQ==",
      "dependencies": {
        "@completium/archetype-ts-types": "^0.0.14",
        "@completium/completium-cli": "^0.4.46",
        "bignumber.js": "^9.0.2"
      }

So I'm assuming this is related to the problem - but still not sure how to fix it (I would have thought npm i?) or what I am doing wrong when I create a project to cause this.

1 Answer 1

2

it is a npm error message relative to two package versions, experiment-ts and archetype-ts-types (the former has a dependency on the later). Either there is an issue in the last versions of these packages that we didn't experience, either one of them needs to be updated to the lastest version on your side. Can you show the package.json?

5
  • Thanks for this reply Benoit. I've added my package.json to the original question. I also tried running npm i again just in case I'd somehow missed that, but that didn't solve the issue - it just output up to date, audited 310 packages
    – Grum
    Dec 3, 2022 at 9:42
  • Okay I'm guessing the problem is the package.json file in the experiment-ts repo is pointing to version 0.0.14 of archetype-ts-types. I'll see if the tests pass if I update this to the latest version and PR
    – Grum
    Dec 3, 2022 at 11:53
  • I've made a pull request with that minor change - that should hopefully sort it. I tried to verify it would work by pointing my package.json in my project to my fork of the experiment-ts repo, but that led to another rabbit hole of problems I'd rather avoid unless absolutely necessary.
    – Grum
    Dec 3, 2022 at 12:48
  • Thanks @grum for the info. It is merged and fixed. The issue in package.json was that the dependency was "^0.0.14" instead of "~0.0.14"; so we have fixed it to "~0.0.16" and "~0.4.49" for completium. so now rm -rf node_modules and npm i should fix it. Dec 3, 2022 at 14:44
  • Thanks, great to know, its fixed now!
    – Grum
    Dec 3, 2022 at 18:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.