Skip to content
Discussion options

You must be logged in to vote

Hello,

The error you're encountering indicates that the TypeScript compiler is unable to find the 'content' property in the object type you're using. To resolve this issue, you need to ensure that the type of the 'result.data' object aligns with the structure you're expecting.

The GitHub API response for fetching a file's content is an array of objects, where each object represents a file or directory in the repository. To access the content of a specific file, you'll need to identify the correct object in the array and access its 'content' property.

Here's an example of how you can modify your code to avoid the type error:

const data = await octokit.request('GET /repos/{owner}/{repo}/con…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@shami-dev
Comment options

@RaflyLesmana3003
Comment options

Answer selected by shami-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apps API and Webhooks Discussions related to GitHub's APIs or Webhooks Question Ask and answer questions about GitHub features and usage
2 participants