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

Document supported @octokit/rest versions #690

Closed
noqcks opened this issue Apr 4, 2024 · 3 comments
Closed

Document supported @octokit/rest versions #690

noqcks opened this issue Apr 4, 2024 · 3 comments

Comments

@noqcks
Copy link

noqcks commented Apr 4, 2024

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/@[email protected]/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/@[email protected]/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.

@wolfy1339
Copy link
Member

Well they aren't compatible because of ESM anyways.

You should always check the release notes

@wolfy1339
Copy link
Member

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

@wolfy1339
Copy link
Member

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

It is documented

@wolfy1339 wolfy1339 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2024
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

No branches or pull requests

2 participants