Skip to content

[BUG]: octokit is missing its @octokit/webhooks dependency #2844

Open
@orionmiz

Description

@orionmiz

What happened?

webhooks property type of App cannot be resolved when using Yarn's Plug'n'Play mode.

Here's dist-types/app.d.ts in [email protected]:

import { App as DefaultApp } from "@octokit/app";
import { OAuthApp as DefaultOAuthApp } from "@octokit/oauth-app";
export declare const App: (new (...args: any[]) => {
    // ...
    webhooks: import("@octokit/webhooks").Webhooks<{ // this property resolves its type as `any`.
        octokit: import("@octokit/core").Octokit & {
            paginate: import("@octokit/plugin-paginate-rest").PaginateInterface;
        } & import("@octokit/plugin-paginate-graphql").paginateGraphQLInterface & import("@octokit/plugin-rest-endpoint-methods").Api & {
            retry: {
                retryRequest: (error: import("@octokit/request-error").RequestError, retries: number, retryAfter: number) => import("@octokit/request-error").RequestError;
            };
        };
    }>;
    // ...
}) & typeof DefaultApp;

It's a typical ghost dependency problem; Exported App type requires dependencies from @octokit/app to be specified in octokit's dependencies as well though it's just exporting the types, not actual module.

Here's a workaround for pnp users like me:

packageExtensions:
  octokit@*:
    dependencies:
      "@octokit/webhooks": "*"

Versions

octokit@npm:4.1.3

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis is being looked at and prioritizedType: BugSomething isn't working as documented

    Type

    No type

    Projects

    Status

    🆕 Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions