Error when importing runtime files to make a DID session with ComposeDB

I’ve followed the Getting Started With ComposeDB On Ceramic page, and everything works great including running the graphql server and making mutations and queries, though I’m hitting an issue with typing when trying to get DIDs running. When I import the runtime file to use with the ComposeClient as shown in this tutorial - Using With ComposeDB Client | Decentralized Identifiers (DIDs) - it gives me the error below.

src/helpers/createDid.ts:58:72 - error TS2322: Type '{ models: { LitAccount: { id: string; accountRelation: { type: string; }; }; LitServiceEntry: { id: string; accountRelation: { type: string; }; }; }; objects: { LitAccount: { email: { type: string; required: boolean; }; username: { ...; }; pkpAddress: { ...; }; }; LitServiceEntryServiceData: { ...; }; LitServiceEntr...' is not assignable to type 'RuntimeCompositeDefinition'.
  Types of property 'models' are incompatible.
    Type '{ LitAccount: { id: string; accountRelation: { type: string; }; }; LitServiceEntry: { id: string; accountRelation: { type: string; }; }; }' is not assignable to type 'Record<string, RuntimeModel>'.
      Property '"LitAccount"' is incompatible with index signature.
        Type '{ id: string; accountRelation: { type: string; }; }' is not assignable to type 'RuntimeModel'.
          Types of property 'accountRelation' are incompatible.
            Type '{ type: string; }' is not assignable to type 'ModelAccountRelation'.

58   const compose = new ComposeClient({ceramic: 'http://localhost:7007', definition});

The runtime file generated by the composedb client hasn’t been altered, and when tracking the type down to the ModelAccountRelation it looks to be correct. As far as I can tell, this is the area of the runtime file it’s referring to:

{
  "models": {
    "LitAccount": {
      "id": "kjzl6hvfrbw6cawggjvayb4ac2l7lg799u648g07p3v9xlh6fby5z1bl8y2vhlj",
      "accountRelation": {
        "type": "single"
      }
    },
    "LitServiceEntry": {
      "id": "kjzl6hvfrbw6c80ccbf7rpz8pqm639vck3ha5aeuftldkayid7f7tysisnvz5dk",
      "accountRelation": {
        "type": "list"
      }
    }
  },

and here’s the line specifying the ModelAccountRelation. it looks like they match, but it’s still throwing an error.

I can suppress it with tsignore, but there’s more to it than just typing

schema.js:436 Uncaught (in promise) Error: Unsupported view type: relation
    at SchemaBuilder._buildDocumentObjectViewField (schema.js:436:1)
    at fields (schema.js:244:1)
    at resolveObjMapThunk (definition.mjs:328:1)
    at defineFieldMap (definition.mjs:532:1)
    at GraphQLObjectType._fields (definition.mjs:473:1)
    at GraphQLObjectType.getFields (definition.mjs:486:1)
    at collectReferencedTypes (schema.mjs:332:1)
    at collectReferencedTypes (schema.mjs:333:1)
    at collectReferencedTypes (schema.mjs:333:1)
    at collectReferencedTypes (schema.mjs:333:1)

i’m stuck at this point for the moment. thanks for checking this out, any help would be greatly appreciated!

@paul could you take a look?

You’re probably using different versions of the devtools and client, please make sure to use the latest versions (v0.3 at the time) of all the packages and CLI, and re-create any composite you may have created with a previous version.

that seemed to get it functioning. i’ve uninstalled and reinstalled everything, and recreated the composites. @ceramicnetwork/cli needed to be upgraded from v0.2.9 to v0.2.11. still seeing the type error, but it’s not breaking anymore. thanks!