GithubHelp home page GithubHelp logo

Comments (3)

gr2m avatar gr2m commented on June 16, 2024

Thank you for the kind words AJ!

Could you please share what versions of the octokit packages you are using (on mac/linux: npm ls | grep octokit)

We upgraded to much better Types today, but I've only run into a few regressions, it's like that you run into one here as well. I'm having a look

from plugin-paginate-rest.js.

gr2m avatar gr2m commented on June 16, 2024

I think I found the problem. @octokit/types will give you the new version with extended types, @octokit/rest gets its version trough its dependency on @octokit/plugin-rest-endpoint-methods, which has not yet been updated in @octokit/rest. That should be easy enough to fix

What I would do is to change your code slightly so you don't need to import @octokit/types separately

import { Octokit } from "@octokit/rest";

const client = new Octokit();

(async () => {
  try {
    const repositories = await client.paginate(
      client.apps.listReposAccessibleToInstallation
    );

    // Iterate over repos
    for (let i = 0; i < repositories.length; i++) {
      //
    }
  } catch (error) {
    // error handling
  }
})();

from plugin-paginate-rest.js.

ajschmidt8 avatar ajschmidt8 commented on June 16, 2024

Thanks, Gregor! That looks like it works. Here are my dependency versions for reference. It's likely that the upgrade was what affected my code since this issue only appeared after updating to the latest version today. Appreciate the help here. I'll close this issue and keep an eye out for the @octokit/rest update.

Working:

{
  "dependencies": {
    "@octokit/auth-app": "^2.9.0",
    "@octokit/plugin-throttling": "^3.3.2",
    "@octokit/rest": "^18.0.6",
    "@octokit/webhooks": "^7.15.1",
  },
  "devDependencies": {
    "@octokit/types": "^5.5.0",
  }
}

Not working:

{
  "dependencies": {
    "@octokit/auth-app": "^2.10.3",
    "@octokit/plugin-throttling": "^3.3.4",
    "@octokit/rest": "^18.0.9",
    "@octokit/webhooks": "^7.15.1",
  },
  "devDependencies": {
    "@octokit/types": "^6.0.1",
  }
}

from plugin-paginate-rest.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.