Skip to content

Fix TS errors #1580

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

Merged
merged 1 commit into from
Mar 6, 2024
Merged

Fix TS errors #1580

merged 1 commit into from
Mar 6, 2024

Conversation

drwpow
Copy link
Contributor

@drwpow drwpow commented Mar 6, 2024

Changes

Fixes #1549 by re-enabling skipLibCheck: true. Also updates some insignificant deps to make the fix easier.

The only significant changes are in openapi-fetch; all the other noise is from a type error from Vite/Vitest 🙃. There are probably other ways to have dealt with it, but this was the simplest. It seems to be an upstream in issue in Rollup (maybe; who knows)

How to Review

  • The existing TS checks will fail now

Checklist

  • Unit tests updated
  • docs/ updated (if necessary)
  • pnpm run update:examples run (only applicable for openapi-typescript)

Copy link

changeset-bot bot commented Mar 6, 2024

🦋 Changeset detected

Latest commit: 264dfb8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openapi-fetch Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

cloudflare-workers-and-pages bot commented Mar 6, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 264dfb8
Status: ✅  Deploy successful!
Preview URL: https://23df9447.openapi-ts.pages.dev
Branch Preview URL: https://fix-types.openapi-ts.pages.dev

View logs

@drwpow drwpow merged commit 4c0c7fc into main Mar 6, 2024
@drwpow drwpow deleted the fix-types branch March 6, 2024 04:57
@ericblade
Copy link

Cheers!

@hungify2022
Copy link

hungify2022 commented Mar 12, 2024

@drwpow
After upgrading to 0.9.3
I have a new error when using this MaybeOptionalInit<paths[P], 'get'>

Type 'paths[P]' does not satisfy the constraint 'Record<HttpMethod, {}>'.
  Type '{ get: { parameters: { query?: { limit?: number | undefined; page?: number | undefined; id?: string | undefined; firstName?: string | undefined; lastName?: string | undefined; email?: string | undefined; phone?: string | undefined; } | undefined; };

I know that error but while interface paths looks like this

export interface paths {
  "/users": {
    /** get users with filter */
    get: operations["FindUsersHttpController_findUsers"];
    /** Create a user */
    post: operations["CreateUserHttpController_create"];
  };
}

Which means 'get' | 'post' does not satisfy the HttpMethod.

Could you help me know how to fix it?
Thanks

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

Successfully merging this pull request may close these issues.

after upgrade from 0.8.2 to 0.9.1, receiving several errors all inside openapi-fetch
3 participants