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]: TypeScript compilation errors with @octokit/rest and latest version of @octokit-types #290

Closed
1 task done
bcoe opened this issue May 1, 2023 · 12 comments · Fixed by #292 · 4 remaining pull requests
Closed
1 task done

[BUG]: TypeScript compilation errors with @octokit/rest and latest version of @octokit-types #290

bcoe opened this issue May 1, 2023 · 12 comments · Fixed by #292 · 4 remaining pull requests
Labels
released Type: Bug Something isn't working as documented

Comments

@bcoe
Copy link

bcoe commented May 1, 2023

What happened?

TypeScript code no longer compiles with the following errors:

node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:3091:60 - error TS2339: Property 'POST /enterprises/{enterprise}/{security_product}/{enablement}' does not exist on type 'Endpoints'.

3091             parameters: RequestParameters & Omit<Endpoints["POST /enterprises/{enterprise}/{security_product}/{enablement}"]["parameters"], "baseUrl" | "headers" | "mediaType">;
                                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:3092:33 - error TS2339: Property 'POST /enterprises/{enterprise}/{security_product}/{enablement}' does not exist on type 'Endpoints'.

3092             response: Endpoints["POST /enterprises/{enterprise}/{security_product}/{enablement}"]["response"];

Versions

>v19.

Relevant log output

node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:3091:60 - error TS2339: Property 'POST /enterprises/{enterprise}/{security_product}/{enablement}' does not exist on type 'Endpoints'.

3091             parameters: RequestParameters & Omit<Endpoints["POST /enterprises/{enterprise}/{security_product}/{enablement}"]["parameters"], "baseUrl" | "headers" | "mediaType">;
                                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:3092:33 - error TS2339: Property 'POST /enterprises/{enterprise}/{security_product}/{enablement}' does not exist on type 'Endpoints'.

3092             response: Endpoints["POST /enterprises/{enterprise}/{security_product}/{enablement}"]["response"];

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bcoe bcoe added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels May 1, 2023
bcoe added a commit to googleapis/google-cloud-node that referenced this issue May 1, 2023
Downgrade octokit until octokit/rest.js#290 is addressed
@wolfy1339
Copy link
Member

This is a known issue and is being worked on.

The version of Octokit packages and the types packages are tied together.
You cannot upgrade one without the other.

There need to be an update to the @octokit/plugin-rest-endpoint-methods, @octokit/plugin-throttling, and @octokit/types

Currently blocked on octokit/types.ts#534 which hopefully will get fixed by octokit/openapi#349

@mattgi
Copy link

mattgi commented May 8, 2023

Is this the same issue as this?

CleanShot 2023-05-08 at 20 31 56

@coxd
Copy link

coxd commented May 8, 2023

@mattgi

It's a different set of errors but same underlying cause.

This is PR that will eventually solve all I believe: octokit/plugin-rest-endpoint-methods.js#632

@wolfy1339
Copy link
Member

Hopefully it will get resolved as soon as octokit/openapi#353 is merged.

@Louis-7
Copy link

Louis-7 commented May 10, 2023

Is there a workaround for this issue, or any backward version I can use?

@Louis-7
Copy link

Louis-7 commented May 10, 2023

Is there a workaround for this issue, or any backward version I can use?

Error has gone after I used this:

{
  "dependencies": {
    "@octokit/rest": "^18.12.0"
  },
  "devDependencies": {
    "@octokit/types": "^9.2.1",
    "typescript": "^5.0.4"
  }
}

The only thing I did was downgrade the @octokit/rest

@benjdlambert
Copy link

@wolfy1339 we're still seeing issues with fresh installs of everything. Is there some other things that need a publish maybe?

203             data: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories"]["response"]["data"]["repositories"];
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts:210:31 - error TS2339: Property 'GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners' does not exist on type 'Endpoints'.

210         parameters: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners"]["parameters"];
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts:211:29 - error TS2339: Property 'GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners' does not exist on type 'Endpoints'.

211         response: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners"]["response"] & {
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@wolfy1339
Copy link
Member

Yes

In this case it's @octokit/plugin-paginate-rest that is still waiting

@wolfy1339
Copy link
Member

wolfy1339 commented May 12, 2023

Every dependant module that relies upon the endpoint types has been updated, I'm now going to release a new version of @octokit/rest with those updated modules.

See #292

wolfy1339 added a commit that referenced this issue May 14, 2023
@github-actions
Copy link
Contributor

🎉 This issue has been resolved in version 19.0.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

@josecosta-shell
Copy link

Still having this problem when using "@octokit/rest": "^20.0.1" and "@octokit/types": "^11.1.0". Specifically using octokit.repos.getContent, I get a message saying the data.sha property doesn't exist:

Property 'sha' does not exist on type '{ type: "dir" | "file" | "submodule" | "symlink"; size: number; name: string; path: string; content?: string | undefined; sha: string; url: string; git_url: string | null; html_url: string | null; download_url: string | null; _links: { ...; }; }[] | { ...; } | { ...; } | { ...; }'.
  Property 'sha' does not exist on type '{ type: "dir" | "file" | "submodule" | "symlink"; size: number; name: string; path: string; content?: string | undefined; sha: string; url: string; git_url: string | null; html_url: string | null; download_url: string | null; _links: { ...; }; }[]'.ts(2339)

@wolfy1339
Copy link
Member

Can you open a new issue, that is different than this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Type: Bug Something isn't working as documented
Projects
Archived in project
7 participants