OSDK Generator v1.0.0 and up - Unable to Compile Typescript

We’ve been using OSDK for about a year now and love it. It fit seamlessly into our existing TS stack and compiled just fine.

Starting with OSDK Generator v1.0.0 and up, the generated TS code no longer passes our TS compiler in two places.

Here’s one example from Ontology.d.ts, located within the /sdk directory:

export interface Ontology extends ClientOntology<typeof Ontology> {
    objects: Objects;
    actions: Actions;
    /** @deprecated use batchActions */
    bulkActions: BulkActions;
    batchActions: BatchActions;
    queries: Queries;
}

The TS compiler throws the following error:

Interface ‘Ontology’ incorrectly extends interface ‘Ontology<{ metadata: { ontologyRid: “ri.ontology.main.ontology.redacted”; ontologyApiName: “redacted”; userAgent: “typescript-sdk/0.16.0 typescript-sdk-generator/1.3.1”; }; objects: { …; }; actions: { …; }; queries: {}; }>’.

This prevents our entire project from compiling. Excluding via tsconfig’s exclude directive does not work.

Has anyone seen this issue and been able to remedy? Thanks in advance.

Thanks for your feedback and pinging us on the community!

version 1.0.0 is relatively and old version, can you please confirm when did you last generated the SDK and which version did you use?

You can get this information from the SDK version tab on the developer console application:

Hey there - good question. I can confirm the compilation issue is present in SDK generator versions 1.3.1, 1.1.4 , and 1.0.0.

And unrelated, but I’ll also add some TSconfig options we use that could influence this:

  • "module": "commonjs" (doubt this would cause this)
  • "target": "es2021" (doubt this would cause this)
  • "lib": ["es2021"] (doubt this would cause this)
  • Strict mode (likely a factor)

Hey Adam,

Would it be possible for you to post a minimal repro on github.com? I don’t see this in my local build and don’t have quite enough information from your post. Another option would be to do a screen share.