Failed to build after setup vessel

I have a HashMap variable, it works fine to build before:

let iter = _registry.keys();

but after setup vessel, got this error during building:

type error [M0072], field keys does not exist in type
{
delete : TokenIndex/2 → ();
entries : () → Iter/1<(TokenIndex/2, AccountIdentifier/4)>;
get : TokenIndex/2 → ?AccountIdentifier/4;
put : (TokenIndex/2, AccountIdentifier/4) → ();
remove : TokenIndex/2 → ?AccountIdentifier/4;
replace : (TokenIndex/2, AccountIdentifier/4) → ?AccountIdentifier/4;
size : () → Nat
}

any idea?

I haven’t been tracking the changes but from your error message it looks like keys was removed from HashMap.

You could get the keys by first getting the entries and then calling HashMap.map where the mapping function returns the first element (the key).

No, it is still there: motoko-base/src/HashMap.mo at master · dfinity/motoko-base · GitHub

@bytesun Please verify that you are using a reset (and complete) version of the base library. Can you check whether vessel accesses the correct motoko-base?

1 Like

changed to the latest version in package-set.dhall

let upstream = https://github.com/dfinity/vessel-package-set/releases/download/mo-0.6.1-20210610/package-set.dhall sha256:5d3cc1e3be83d178f0e2210998f8266e536ebd241f415df8e87feb53effe6254

and got this error:

Stderr:
.vessel/base/a6301031d21449d38eb64a72e3e9dd0ad8447a86/src/Principal.mo:19.51-19.55: type error [M0072], field principalOfBlob does not exist in type
module {

That is an “ancient” release. I suggest updating your dfx first and the hunt down a matching package set for vessel.

1 Like