/home/ubuntu/Downloads/node_modules/dids/lib/did.js:175
throw new Error(Failed to resolve ${didUrl}: ${error}${maybeMessage});
^
Error: Failed to resolve did:key:zDnaezUFn4zmNoNeZvBEdVyCv6MVL69X8NRD8YavTCJWGuXM7#zDnaezUFn4zmNoNeZvBEdVyCv6MVL69X8NRD8YavTCJWGuXM7: invalidDid, TypeError: Cannot read properties of undefined (reading ‘keyToDidDoc’)
at DID. (/home/ubuntu/Downloads/node_modules/dids/lib/did.js:175:23)
at Generator.next ()
at fulfilled (/home/ubuntu/Downloads/node_modules/dids/lib/did.js:5:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
I have a stub called: GitHub - bshambaugh/key-did-provider-p256 . This I recall was an earlier attempt to develop a did-provider that generated a key pair within the library like
key-did-provider-ed25519 or key-did-provider-secp256k1 .
Once this is done, the layer of complexity can be added back that pulls in the signature over a stream (i.e [1]) instead of doing it local to the js code like all of your did providers have before.
I get the code to reproduce the issue. It seems to me that you use some old version of key-did-resolver, which does not support yet secp256r1 did key. Try recent version maybe @bshambaugh ? On the recent version, your did:key:zDnaezUFn4zmNoNeZvBEdVyCv6MVL69X8NRD8YavTCJWGuXM7 resolves all right.
hmm…I think it was the case that I have a key-did-resolver version that was outdated. I’m getting a funny error with the latest version of the key-did-resolver.
const did = new DID({ provider, resolver: KeyResolver.getResolver() })
Type ‘ResolverRegistry’ is not assignable to type ‘Resolver | ResolverRegistry’.
Type ‘ResolverRegistry’ is missing the following properties from type ‘Resolver’: registry, cache, resolvets(2322)
did.d.ts(72, 5): The expected type comes from property ‘resolver’ which is declared here on type ‘DIDOptions’