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

Broken function TypeScript types in version 2.34.0 #55

Closed
ihmpavel opened this issue Jul 3, 2024 · 2 comments
Closed

Broken function TypeScript types in version 2.34.0 #55

ihmpavel opened this issue Jul 3, 2024 · 2 comments

Comments

@ihmpavel
Copy link

ihmpavel commented Jul 3, 2024

After upgrading from 2.33.0 to 2.34.0 return types are broken.

Working 2.33.0:

type CustomerRetrieveInput = Parameters<typeof Customer.retrieve>
type CustomerRetrieveOutput = Promise<{
  card: Card
  customer: Customer
}>
const customerRetrieve = (
  customerId: CustomerRetrieveInput[0],
  params?: CustomerRetrieveInput[1]
): CustomerRetrieveOutput => chargebee.customer.retrieve(customerId, params).request()

Not working 2.34.0 - same code.
Issue:
image


One liner:
image


After looking into the changes made 8a4e9fa#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R23-L27 it looks like the problem is changing @types/q from devDependencies to dependencies.

@ihmpavel ihmpavel changed the title Broken return TypeScript types in version 2.34.0 Broken function TypeScript types in version 2.34.0 Jul 3, 2024
@cb-alish
Copy link
Collaborator

cb-alish commented Jul 4, 2024

Hi @ihmpavel , thanks for reporting this and sorry for the trouble. We’ve reverted the change which caused this issue for now. Please try v2.35.0 and let us know if you still face any issue.

@ihmpavel
Copy link
Author

ihmpavel commented Jul 4, 2024

Hi @cb-alish, with 2.35.0 everything works now!

Thanks

@cb-alish cb-alish closed this as completed Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants