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

[BUG]: Property 'login' does not exist on type 'SerializeObject<UndefinedToOptional<{...}>> #339

Open
1 task done
dantevvp opened this issue Aug 22, 2023 · 4 comments
Open
1 task done
Labels
hacktoberfest Issues for participation in Hacktoberfest Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented

Comments

@dantevvp
Copy link

What happened?

After updating Octokit from 2.0.14 to the latest version and running typecheck, I started seeing this error appearing for this code:

const { data: { installations } } = await octokit.rest.apps.listInstallationsForAuthenticatedUser();

installations.map((installation) => installation.account!.login)
Property 'login' does not exist on type 'SerializeObject<UndefinedToOptional<{ name?: string | null | undefined; email?: string | null | undefined; login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string | null; url: string; html_url: string; ... 11 more ...; starred_at?: string | undefined; }>> | SerializeObject<...>'.

Property 'login' does not exist on type 'SerializeObject<UndefinedToOptional<{ description?: string | null | undefined; html_url: string; website_url?: string | null | undefined; id: number; node_id: string; name: string; slug: string; created_at: string | null; updated_at: string | null; avatar_url: string; }>>'

Is there something missing on my side? Or is this a bug? I noticed that the error does not appear if I try to access any of the following properties:

- avatar_url
- html_url
- id
- name?
- node_id

But it does happen for any other property, like description?. I can't seem to figure out if there's a pattern here. This worked fine in previous versions with openapi-types = 16.0.0

I apologize if this is not a bug. Thanks!

Versions

Octokit 3.1.0 with openapi-types on 18.0.0.

Previously, was using Octokit 2.0.14 with openapi-types on 16.0.0.

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@dantevvp dantevvp added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Aug 22, 2023
@github-actions
Copy link

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@kfcampbell kfcampbell added Status: Up for grabs Issues that are ready to be worked on by anyone and removed Status: Triage This is being looked at and prioritized labels Aug 24, 2023
@codingdiaz
Copy link

We are seeing this as well.

@wolfy1339
Copy link
Member

Could be fixed by octokit/openapi#388

@nickfloyd nickfloyd added the hacktoberfest Issues for participation in Hacktoberfest label Sep 21, 2023
@wolfy1339
Copy link
Member

@dantevvp Can you double check with the latest releases if this is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Issues for participation in Hacktoberfest Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented
Projects
Status: 🔥 Backlog
Development

No branches or pull requests

5 participants