decentralized-identity / did-resolver

Universal did-resolver for javascript environments
Apache License 2.0
213 stars 44 forks source link

[bug] private member `registry` leads to typescript compiler errors #109

Closed mirceanis closed 2 years ago

mirceanis commented 2 years ago

In a project with complex dependency tree it can happen that there are 2 or more versions of did-resolver in use. The class Resolver has a private registry member, which leads to broken builds when it is imported from different versions of the library.

Argument of type '{ [x: string]: DIDResolver | DIDResolver; }' is not assignable to parameter of type 'ResolverRegistry'.
'string' index signatures are incompatible.
  Type 'DIDResolver | DIDResolver' is not assignable to type 'DIDResolver'.
    Type 'import("..../node_modules/did-resolver/lib/resolver").DIDResolver' is not assignable to type 'import("..../node_modules/did-resolver/lib/resolver").DIDResolver'.
      Types of parameters 'resolver' and 'resolver' are incompatible.
        Type 'import("..../node_modules/did-resolver/lib/resolver").Resolver' is not assignable to type 'import("..../node_modules/did-resolver/lib/resolver").Resolver'.
          Types have separate declarations of a private property 'registry'.

I believe this could be fixed by avoiding the use of class Resolver as a type in other definitions.

uport-automation-bot commented 2 years ago

:tada: This issue has been resolved in version 3.1.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket: