octokit / rest.js

GitHub REST API client for JavaScript

Home Page:https://octokit.github.io/rest.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typescript compilation failures

Stono opened this issue · comments

Checklist

Environment

Versions

❯ npm ls | grep -v deduped | grep octokit
├── @octokit/rest@18.10.0

What happened?

As of today our builds using @octokit/rest@18.10.0 have started failing to compile with this error:

node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts(1351,31): error TS2339: Property 'GET /user/{username}/packages' does not exist on type 'Endpoints'.
node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts(1352,29): error TS2339: Property 'GET /user/{username}/packages' does not exist on type 'Endpoints'.
node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts(1475,60): error TS2339: Property 'GET /user/{username}/packages' does not exist on type 'Endpoints'.
node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts(1476,33): error TS2339: Property 'GET /user/{username}/packages' does not exist on type 'Endpoints'.

We have not changed the version of the package, so this feels like some sort of transitive dependency issue.

Minimal test case to reproduce the problem

Build an app with @octokit/rest@18.10.0

What did you expect to happen?

Typescript compilation to work

What the problem might be

This feels similar to octokit/plugin-rest-endpoint-methods.js#172, https://www.npmjs.com/package/@octokit/plugin-rest-endpoint-methods was published 17 hours ago so feels somewhat suspicious

I'm looking into it right now, will be fixed with octokit/plugin-paginate-rest.js#363

Cheers @gr2m :) Let me know when the packages are published and i'll test it on my end.

Can you try again? Make sure to update your lock file and the dependency tree. Make sure you have @octokit/plugin-rest-endpoint-methods@5.11.1 and @octokit/plugin-paginate-rest@2.16.4

@gr2m just gave it another go this time i get:

node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts(1351,31): error TS2339: Property 'GET /user/{username}/packages' does not exist on type 'Endpoints'.
node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts(1352,29): error TS2339: Property 'GET /user/{username}/packages' does not exist on type 'Endpoints'.

Looks like its pulling in 2.16.3 of @octokit/plugin-paginate-rest however:

❯ cat node_modules/@octokit/plugin-paginate-rest/package.json|grep version
  "version": "2.16.3",

That's with a fresh rm -rf ./node_modules so struggling to get it to install 2.16.4 (which i do see published https://www.npmjs.com/package/@octokit/plugin-paginate-rest)

Hmm I had to rm -rf ~/.npm too to get it to do 2.16.4, event --prefer-online didn't help.

❯ cat node_modules/@octokit/plugin-paginate-rest/package.json|grep version
  "version": "2.16.4",

Now that we have that dependency, it builds OK.
Is it worth explicitly bumping the minimum version in @octokit/rest to ensure this gets picked up properly?

Is it worth explicitly bumping the minimum version in @octokit/rest to ensure this gets picked up properly?

already ahead of you 😁
https://github.com/octokit/rest.js/releases/tag/v18.11.0

Sorted :)