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
TypeScript signature of async iterators changed unexpectedly: #82
Comments
If you need to iterate through repositories I'd recommend using https://github.com/octokit/app.js/ :) I hope to migrate Probot to it with the next version, but not sure how long that will take. I'm looking into the type change now |
Hm it looks like it returns both, which is incorrect. But when you do the |
I couldn't reproduce the problem with
Then create index.ts import { Octokit } from "@octokit/rest";
const octokit = new Octokit();
export async function* test() {
const installationRepositoriesPaginated = octokit.paginate.iterator(
octokit.apps.listReposAccessibleToInstallation,
{
mediaType: {
previews: ["machine-man"],
},
}
);
for await (const response of installationRepositoriesPaginated) {
for (const repo of response.data) {
yield repo;
}
}
} And I don't see any relevant diffs from my dependency trees to the one you shared. Interestingly, both |
@gr2m I did a bit more experimentation and the issue crops up for us between |
Still no luck on my side reproducing the problem, sorry 😞 Could you create a repository with my test code above that throws the error when building? |
I think it has something todo with the configuration in {
"extends": "./node_modules/gts/tsconfig-google.json",
"compilerOptions": {
"lib": ["es2018", "dom"],
"esModuleInterop": true,
"rootDir": ".",
"outDir": "build"
},
"include": ["*.ts"]
} The error does not occur if I remove the |
It's the {
"compilerOptions": {
"strict": true,
"lib": ["es2018"]
},
"include": ["*.ts"]
} |
I'll have to get back to this later. We do have the |
@gr2m thanks for digging into this 👏 I'll play myself with settings. |
I was able to get things compiling by merging |
FWIW, we are having the same problem. |
Seeing something similar recently as well. EDIT: oopps didn't see the date. I'll post more if I can figure out what caused this. |
Checklist
Environment
Versions
What happened?
In a minor version of one of the octokit dependencies, the method signature of pagination has changed significantly. This was the old code that worked:
When updating to the latest versions of libraries in
package-lock.json
, compilation fails due to a significantly different type:Rather than being an
array
,data
now returns an object with a top levelrepositories
field which is an array.Minimal test case to reproduce the problem
Renovates routine lock maintenance surfaces issue:
googleapis/repo-automation-bots#2241
What did you expect to happen?
Type to remain similar in a minor or patch update.
What the problem might be
Not sure.
The text was updated successfully, but these errors were encountered: