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]: Uncaught TypeError: Cannot read properties of undefined (reading 'map') - #485

Closed
1 task done
ianFar96 opened this issue Jun 19, 2023 · 3 comments
Closed
1 task done
Assignees
Labels
released Type: Bug Something isn't working as documented

Comments

@ianFar96
Copy link

What happened?

My web-app uses octokit/graphql.js to fetch pull requests, until two days ago it worked like a charm, now coincidentally with the 6.0.0 breaking version I get this error in the console: Uncaught TypeError: Cannot read properties of undefined (reading 'map') - endpoint.js.
image

This is how I declare the defaults:

this.githubGraphql = graphql.defaults({
	baseUrl: config.baseUrl,
	headers: {
		Accept: 'application/vnd.github+json',
		authorization: `token ${config.auth}`,
	},
});

And this is how I make the calls:

this.githubGraphql<{node: GithubGraphqlProjectResponse}>({query: `{
	node(id: "${mergeRequest.projectId}"){
		... on Repository {
			id
			name
		}
	}
}`})

Versions

Octokit.js v5.0.5 and 6.0.0 (tried also the new one with no success)

Relevant log output

Uncaught TypeError: Cannot read properties of undefined (reading 'map') - endpoint.js

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ianFar96 ianFar96 added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Jun 19, 2023
@wolfy1339
Copy link
Member

What version of @octokit/endpoint is being pulled in via @octokit/request?

This bug was fixed in octokit/endpoint.js#427

@wolfy1339 wolfy1339 added Priority: High and removed Status: Triage This is being looked at and prioritized labels Jun 20, 2023
@wolfy1339
Copy link
Member

The proper fix for web users is to upgrade @octokit/endpoint in @octokit/request, and update it here, then release it

@wolfy1339 wolfy1339 self-assigned this Jun 20, 2023
@github-actions
Copy link

🎉 This issue has been resolved in version 6.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Type: Bug Something isn't working as documented
Projects
Archived in project
Development

No branches or pull requests

2 participants