Comments (14)
Post Mortem: "Property 'GET /user/:migration_id/repositories' does not exist on type 'Endpoints'" TypeScript error
- Impact: TypeScript compilation errors. No production errors.
- First report: July 22, 7:16pm PDT
- Affected packages:
@octokit/[email protected]
,@octokit/[email protected]
,@octokit/[email protected]
- Fixed packages:
@octokit/[email protected]
,@octokit/[email protected]
,@octokit/[email protected]
- Confirmed: Jul 23, 11:01am PDT
Summary
Starting July 22, 4:20pm PDT, TypeScript users of the latest @octokit/rest
version (18.x) started to see the following errors when compiling their code:
Property 'GET /user/:migration_id/repositories' does not exist on type 'Endpoints'
The error originated from two @octokit/rest
dependencies.
@octokit/plugin-rest-endpoint-methods
@octokit/plugin-paginate-rest
The problem was originally reported by the TypeScript team on July 22, 7:16pm PDT (issue). The problem was resolved via @octokit/[email protected]
and @octokit/[email protected]
, confirmed on Jul 23, 11:01am PDT (comment)
What happened
The source of the problem was a GitHub REST API path correction, which was published in the @github/openapi
package version 5.0.2 on July 22, 12:02pm PDT.
- Before (5.0.1): https://unpkg.com/browse/@github/[email protected]/dist/api.github.com.json#L50802
- After (5.0.2): https://unpkg.com/browse/@github/[email protected]/dist/api.github.com.json#L49639
Sever @octokit/*
libraries receive automated pull request whenever a new version of the @github/openapi
package is released. One such pull request updated @octokit/types
in octokit/types.ts#137, which changed the /user/{migration_id}/repositories
path to /user/migrations/{migration_id}/repositories
. Once merged, the new version 5.1.1 was published to npm. We do not consider typescript changes to be breaking changes, as they do not impact code run in production, only at build time during local development or CI/CD.
Another pull request was for @octokit/plugin-rest-endpoints
octokit/plugin-rest-endpoint-methods.js#171, in which the @octokit/types
dependency was updated besides the path updates, in order to keep the two in sync.
The problem is that while @octokit/rest
has a pinned dependency on @octokit/plugin-rest-endpoints
, octokit/plugin-rest-endpoints
does not have a pinned dependency on @ocotkit/types
(in order to allow npm to de-duplicate it as it's required by many @octokit/*
packages). That's how @octokit/plugin-rest-endpoints
and @ocotkit/types
became out of sync in the dependency tree of @octokit/rest
.
The problem with the @octokit/plugin-rest-endpoints
dependency was resolved via octokit/rest.js#1811 and a new version was released: @octokit/[email protected]
.
On top of that, the automated update of @octokit/plugin-paginate-rest
triggered by the new @github/openapi
release failed silently: https://github.com/octokit/plugin-paginate-rest.js/runs/899898279?check_suite_focus=true#step:6:14. @octokit/plugin-paginate-rest
uses @octokit/types
for internal type definitions, too. That is how @octokit/plugin-paginate-rest
and @octokit/types
became out of sync. The problem was resolved via octokit/plugin-paginate-rest.js#110 and a new version was released: @octokit/[email protected]
.
With @octokit/[email protected]
and @octokit/[email protected]
, the "Property 'GET /user/:migration_id/repositories' does not exist on type 'Endpoints'" TypeScript error no longer occurs.
How we will prevent the problem from occurring again
In future, we will consider the removal or change of a type definition in @octokit/types
to be a breaking change. While we won't consider TypeScript changes to be breaking changes overall, as they do not impact code run in production, this incident showed that due to dependency on @ocotkit/types
across many @octokit/*
packages the risk of out-of-sync packages is too high.
Had we published @octokit/[email protected]
as @octokit/[email protected]
instead, none of the problems had occurred. The worst impact would be that different versions might have existed in the @ocotkit/rest
dependency tree for a short amount of time.
As we will be more strict with breaking changes on @octokit/types
moving forward, we will also invest time to avoid breaking changes in the first place, by implementing deprecations, as we do in our JavaScript packages such as @octokit/rest
and @octokit/plugin-rest-endpoint-methods
. Breaking changes will only occur to remove previously deprecated APIs.
The other problem this incident surfaced was the silent error at https://github.com/octokit/plugin-paginate-rest.js/runs/899898279?check_suite_focus=true#step:6:14. We will make sure that the GitHub OpenAPI update builds will fail in future, which will trigger a notification.
Please comment below if you have any further questions.
from plugin-rest-endpoint-methods.js.
The problem should be fixed now. You need to update to latest @octokit/rest
(18.0.2) and also make sure that to have the latest @octokit/plugin-paginate-rest
sub dependency (2.2.4)
➜ TypeScript git:(master) ✗ npm ls @octokit/plugin-paginate-rest
[email protected] /private/var/folders/hs/x9qtfmvn1lz1sgml9q21h7k80000gn/T/tmp.5Ggh7uap/TypeScript
└─┬ @octokit/[email protected]
└── @octokit/[email protected]
Can you verify?
I'll write up a post-mortem to explain what happened, how I'll make sure it won't happen again.
from plugin-rest-endpoint-methods.js.
Odd, can you make sure if you have the latest version of @octokit/types in your dependency tree?
from plugin-rest-endpoint-methods.js.
I was able to reproduce the problem. I think I know what happened, please give me a moment to verify.
from plugin-rest-endpoint-methods.js.
Thank you for confirming!
from plugin-rest-endpoint-methods.js.
I am seeing this same error with the following versions:
"devDependencies": {
"@octokit/types": "5.1.1",
"typescript": "3.9.7"
},
"dependencies": {
"@octokit/rest": "18.0.1"
}
Error log:
$ tsc
../node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts:987:31 - error TS2339: Property 'GET /user/:migration_id/repositories' does not exist on type 'Endpoints'.
987 parameters: Endpoints["GET /user/:migration_id/repositories"]["parameters"];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts:988:29 - error TS2339: Property 'GET /user/:migration_id/repositories' does not exist on type 'Endpoints'.
988 response: Endpoints["GET /user/:migration_id/repositories"]["response"];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:961:60 - error TS2339: Property 'GET /user/:migration_id/repositories' does not exist on type 'Endpoints'.
961 parameters: RequestParameters & Omit<Endpoints["GET /user/:migration_id/repositories"]["parameters"], "baseUrl" | "headers" | "mediaType">;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts:962:33 - error TS2339: Property 'GET /user/:migration_id/repositories' does not exist on type 'Endpoints'.
962 response: Endpoints["GET /user/:migration_id/repositories"]["response"];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 4 errors.
from plugin-rest-endpoint-methods.js.
@gr2m To clarify, I'm not talking about tsc
failing for a project that I've written which uses the plugin. I'm referring to the source for the TypeScript compiler, itself, which has broad impact.
All versions above 3.8 are failing to build: microsoft/TypeScript#39712
This includes old releases which haven't been updated up to the latest. This seems to have happened as of a recent update for this plugin. (Not sure how long it's been happening. I discovered it yesterday)
Steps to reproduce can be found in the issue above.
from plugin-rest-endpoint-methods.js.
Odd, can you make sure if you have the latest version of @octokit/types in your dependency tree?
For me, I can see three major versions of @octokit/types in the lockfile (2, 4 and 5). @octokit/rest@^16.43.1
wants @octokit/plugin-rest-endpoint-methods=2.4.0
which in turn wants @octokit/types^2.0.1
. If I add @octokit/types to my dependencies then everything is happy again.
Edit: In fact I had the @octokit/types^4.0.1
in my dependencies already - that'll be what did it for me. Many major version bumps recently!
from plugin-rest-endpoint-methods.js.
oh my, I'm looking into it
from plugin-rest-endpoint-methods.js.
I was having the identical issue to @nonara . Updated to @octokit/[email protected]
and builds are completing.
"devDependencies": {
"@octokit/types": "5.1.1",
"typescript": "3.9.7"
},
"dependencies": {
"@octokit/rest": "18.0.2"
}
from plugin-rest-endpoint-methods.js.
Thanks for the fast turnaround, @gr2m! Confirming now...
from plugin-rest-endpoint-methods.js.
Fresh clone compiles! 🎉
from plugin-rest-endpoint-methods.js.
thanks folks
from plugin-rest-endpoint-methods.js.
Awesome work! 👍
from plugin-rest-endpoint-methods.js.
Related Issues (20)
- Incorrect type for setLabels HOT 2
- build is failing on latest release HOT 1
- Very big misunderstanding /NOT ME!
- How to update some of the endpoints HOT 1
- Hello
- CodeQL Check Run requires write access when running for 'push' events HOT 1
- Remove unnecessary step for CodeQL workflow HOT 1
- no
- Compile error regarding rest endpoint method types HOT 12
- Remove Node version 10 from .github/workflows/test.yml
- Suspend a users on GHES? HOT 5
- [BUG]: [Create Review] 422: Unprocessable Entity: Review comments is invalid and Review threads is invalid HOT 2
- [BUG]: `position` marked necessary in `createReview` while it's not HOT 2
- [BUG]: No way to add new methods to octokit.rest.repos in v7 HOT 6
- [BUG]: Upgrading from `@actions/github` V5 -> V6 caused TypeErrors within `getOcktokit()` HOT 6
- [BUG]: createOrUpdateFileContents results in error 504 HOT 4
- [BUG]: Peer dependency of @octokit/core@">=5" broken as @octokit/core@6 is ESM HOT 2
- export dist-src/generated/endpoints.js? HOT 4
- [BUG]: Property 'POST /repos/{owner}/{repo}/pages/deployment' does not exist on type 'Endpoints'. HOT 3
- [BUG]: CommonJS `require()` is broken. HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plugin-rest-endpoint-methods.js.