instructor-js icon indicating copy to clipboard operation
instructor-js copied to clipboard

Error when compiling with tsc version 5.5.3

Open Avi-W opened this issue 1 year ago • 0 comments

When compiling I am getting the following error:

node_modules/@instructor-ai/instructor/dist/index.d.cts:103:129 - error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.

103             }>(params: P, requestOptions?: ClientTypeChatCompletionRequestOptions<C>) => Promise<ReturnTypeBasedOnParams<typeof this.client, P>>;
                                                                                                                                    ~~~~


Found 1 error in node_modules/@instructor-ai/instructor/dist/index.d.cts:103

tsconfig.json:

{
  "compilerOptions": {
    "target": "es2021",
    "lib": ["es2021"],
    "module": "node16",
    "types": ["node"],
    "outDir": "../dist",
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "exactOptionalPropertyTypes": true,
    "inlineSourceMap": true,
  }
}

I was able to ignore the issue with adding "skipLibCheck": true, to tsconfig but that is not optimal.

Thank you!

Avi-W avatar Jul 18 '24 13:07 Avi-W