Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
vladb opened this issue Oct 10, 2024 · 4 comments · Fixed by #133
Closed
1 task done

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

vladb opened this issue Oct 10, 2024 · 4 comments · Fixed by #133
Assignees
Labels
bug Something isn't working

Comments

@vladb
Copy link

vladb commented Oct 10, 2024

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

  • I agree to follow this project's Code of Conduct
@vladb vladb added the bug Something isn't working label Oct 10, 2024
@vladb
Copy link
Author

vladb commented Oct 10, 2024

using typescript 5.6.2

@csgulati09
Copy link
Collaborator

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.

@vladb
Copy link
Author

vladb commented Oct 10, 2024

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/**/*"]
}

@csgulati09
Copy link
Collaborator

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 added a commit that referenced this issue Oct 17, 2024
@csgulati09 csgulati09 self-assigned this Oct 17, 2024
csgulati09 added a commit that referenced this issue Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants