question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Property `content` does not exist on type `ReposGetContentsResponse`

See original GitHub issue

Bug Report

Full source: https://github.com/Logerfo/close-label

Current Behavior

Heroku build failed after upgrading from v9.4.0 to v9.5.0:

error TS2339: Property content does not exist on type ReposGetContentsResponse. Property content does not exist on type ReposGetContentsResponseItem[].

let content
try {
    content = await context.github.repos.getContents(context.repo({
        path: '.github/close-label.yml',
    }))
}
catch {
    app.log('.github/close-label.yml not found. Stepping out...')
    return
}
const config = yaml.safeLoad(Buffer.from(content.data.content, 'base64').toString()) //error here

Environment

  • Probot version(s): v9.5.0
  • Node/npm version: 12.10.0/6.10.3
  • OS: IDK (Heroku)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
gr2mcommented, Sep 24, 2019

The change in https://github.com/Logerfo/close-label/commit/d1c20b83ed9eeed80eefcc9cc6178601e3565d09 looks good 👍

Note that https://github.com/probot/probot-config is now included in probot itself, so you don’t need to implement reading the config file yourself

<div> GitHub</div><div>probot/probot-config</div><div>A Probot extension to easily share configs between repositories. - probot/probot-config</div>
1reaction
issue-label-bot[bot]commented, Sep 23, 2019

Issue-Label Bot is automatically applying the label bug 🐞 to this issue, with a confidence of 0.97. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript type assertion for type that can be an array or plain
You can use !Array.isArray(fileInfo.data) && typeof fileInfo.data === 'object' to check if a variable is array or not and it is an object....
Read more >
배열 또는 일반일 수 있는 유형에 대한 Typescript 유형 주장 ...
type ReposGetContentsResponse = | { _links: ReposGetContentsResponseLinks; ... Returns contents of a file, if ref is not specified, it will use the default ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found