portkey-node-sdk
portkey-node-sdk copied to clipboard
[Bug]: Spread types may only be created from object types
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
using typescript 5.6.2
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.
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/**/*"]
}
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.