Content-Length: 307342 | pFad | https://github.com/octokit/octokit.js/issues/2844

52 [BUG]: `octokit` is missing its `@octokit/webhooks` dependency · Issue #2844 · octokit/octokit.js · GitHub
Skip to content

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

@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 octokit@4.1.3:

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

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/octokit/octokit.js/issues/2844

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy