portkey-node-sdk icon indicating copy to clipboard operation
portkey-node-sdk copied to clipboard

[Bug]: Spread types may only be created from object types

Open vladb opened this issue 1 year ago • 3 comments

What happened?

Getting the following error with portkey-node-sdk 1.5.1, 1.5.0, 1.4.0 (possibly below as well, haven't checked).

node_modules/portkey-ai/dist/src/baseClient.ts:60:7 - error TS2698: Spread types may only be created from object types.

60       ...(await response.json()),
         ~~~~~~~~~~~~~~~~~~~~~~~~~~

Version

0.1.xx (Default)

Relevant log output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

vladb avatar Oct 10 '24 14:10 vladb

using typescript 5.6.2

vladb avatar Oct 10 '24 14:10 vladb

Hey! Thanks for raising the issue. Just wanted to know what is your tsconfig.json? This bit of code seems to be unchanged for a while now. Not sure how this issue is showing up now.

csgulati09 avatar Oct 10 '24 15:10 csgulati09

Hey, thanks for getting back.

Here's my tsconfig.json:

{
  "compilerOptions": {
    "esModuleInterop": true,
    "skipLibCheck": true,
    "target": "es2022",
    "allowJs": true,
    "resolveJsonModule": true,
    "moduleDetection": "force",
    "isolatedModules": true,
    "verbatimModuleSyntax": false,

    "strict": true,
    "noUncheckedIndexedAccess": false,
    "noImplicitOverride": true,
    "noImplicitAny": false,

    "module": "NodeNext",
    "outDir": "dist",
    "sourceMap": true,

    "lib": ["es2022"]
  },
  "exclude": ["generated/**/*"]
}

vladb avatar Oct 10 '24 16:10 vladb

Hey! So this was coming because of the latest TS package and the user's tsconfig. Which is understandable. I have done a simple fix for the issue. Will be raising a PR against it and making a release for it soon. Thanks for pointing this one out.

csgulati09 avatar Oct 17 '24 09:10 csgulati09