Unsure if this is a relic of my own tsconfig, but ceramic types throw ts error
Schwartz10 opened this issue · 3 comments
Schwartz10 commented
The follow ts code:
const authSecret = fromString(process.env.PDM_SEED!);
const ceramic = new Ceramic(process.env.NEXT_PUBLIC_CERAMIC_URL!);
try {
const threeID = await ThreeID.create({
authId: "genesis",
authSecret,
getPermission: () => Promise.resolve([]),
ceramic,
});
await ceramic.setDIDProvider(threeID.getDidProvider());
} finally {
await ceramic.close();
}
Throws the error:
Type 'CeramicClient' is not assignable to type 'CeramicApi'.
Types of property 'did' are incompatible.
Type 'import("/Users/jonathanschwartz/Documents/daemon-land/pdm/node_modules/@ceramicnetwork/http-client/node_modules/dids/lib/index").DID | undefined' is not assignable to type 'import("/Users/jonathanschwartz/Documents/daemon-land/pdm/node_modules/dids/lib/index").DID | undefined'.
Type 'import("/Users/jonathanschwartz/Documents/daemon-land/pdm/node_modules/@ceramicnetwork/http-client/node_modules/dids/lib/index").DID' is not assignable to type 'import("/Users/jonathanschwartz/Documents/daemon-land/pdm/node_modules/dids/lib/index").DID'.
Types have separate declarations of a private property '_client'.ts(2322)
threeid-provider.d.ts(19, 5): The expected type comes from property 'ceramic' which is declared here on type 'IDWConfig'
I'm running @ceramicnetwork/http-client@0.9.6
and 3id-did-provider@0.5.1
oed commented
Can you check if you got two different versions of dids
installed?
npm list dids
Schwartz10 commented
Ah yes, but the versions are coming from different packages:
pdm@0.0.1 /Users/jonathanschwartz/Documents/daemon-land/pdm
├─┬ 3id-did-provider@0.5.1
│ └── dids@1.1.1
├─┬ @ceramicnetwork/http-client@0.9.6
│ └── dids@1.1.1
├─┬ @daemon-land/types@0.0.1-alpha.27
│ └── dids@1.1.1
└── dids@2.0.0
Which one is right?
oed commented
Safe bet is to use 1.1.1
for now. V2 is used in the upcoming Ceramic release.