Skip to content

Document supported @octokit/rest versions #690

Closed as not planned
Closed as not planned

Description

@noqcks

I'm trying to use @octokit/rest w/ this plugin

package.json

 "dependencies": {
    "@octokit/plugin-throttling": "^9.1.0",
    "@octokit/rest": "^20.1.0",
  }

index.ts

import { Octokit } from "@octokit/rest";
import { throttling } from "@octokit/plugin-throttling";

const MyOctokit = Octokit.plugin(throttling);

and I get the type error

Argument of type 'typeof throttling' is not assignable to parameter of type 'OctokitPlugin'.
  Types of parameters 'octokit' and 'octokit' are incompatible.
    Type 'import("/Users/noqcks/go/src/github.com/xeol-io/swe-bump-bench/node_modules/.pnpm/@octokit+core@5.1.0/node_modules/@octokit/core/dist-types/index").Octokit' is not assignable to type 'import("/Users/noqcks/go/src/github.com/xeol-io/swe-bump-bench/node_modules/.pnpm/@octokit+core@6.1.1/node_modules/@octokit/core/dist-types/index").Octokit'.
      The types of 'hook.before' are incompatible between these types.
        Type '<Name extends keyof Hooks>(name: Name, beforeHook: BeforeHook<GetType<Hooks[Name], "Options", "O">>) => void' is not assignable to type '<Name extends keyof Hooks>(name: Name, beforeHook: BeforeHook<GetType<Hooks[Name], "Options">>) => void'.
          Types of parameters 'beforeHook' and 'beforeHook' are incompatible.
            Types of parameters 'options' and 'options' are incompatible.
              Type 'GetType<Hooks[Name], "Options", "O">' is not assignable to type 'GetType<Hooks[Name], "Options">'.
                Type 'Hooks[Name][keyof Hooks[Name] & "Options"] | ("O" extends keyof Hooks[Name] ? Hooks[Name][keyof Hooks[Name] & "O"] : any)' is not assignable to type 'GetType<Hooks[Name], "Options">'.
                  Type 'Hooks[Name][keyof Hooks[Name] & "Options"]' is not assignable to type 'GetType<Hooks[Name], "Options">'.
                    Type 'Hooks[Name]["Options"]' is not assignable to type 'GetType<Hooks[Name], "Options">'

it looks @octokit/plugin-throttling and @octokit/rest are using different versions of @octokit/core -- 5.1.0 and 6.1.1 respectively.

Activity

  1. wolfy1339 commented on Apr 4, 2024

    @wolfy1339
    Member

    Well they aren't compatible because of ESM anyways.

    You should always check the release notes

  2. wolfy1339 commented on Apr 4, 2024

    @wolfy1339
    Member

    @octokit/rest is currently blocked by octokit/rest.js#413

  3. wolfy1339 commented on Apr 5, 2024

    @wolfy1339
    Member

    The dependency on @octokit/core is defined in the peerDependencies

    It is documented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions