Toolkit: Property 'issues' does not exist on type 'GitHub'

Created on 5 Feb 2020  路  3Comments  路  Source: actions/toolkit

Describe the bug
Hi,

I had the following build error.

src/main.ts:40:28 - error TS2339: Property 'issues' does not exist on type 'GitHub'.

40         await githubClient.issues.createComment({
                              ~~~~~~


Found 1 error.

image

I use @actions/[email protected]. This bug may be a bug of octoki/rest.js.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

bug

All 3 comments

I was having similar issues on this. I found that my type definition file generated as part of the github actions package here:
node_modules/@actions/github/lib/github.d.ts

imports Octokit as a default instead of as a decomposed import:

import { graphql as GraphQL } from '@octokit/graphql/dist-types/types';
import Octokit from '@octokit/rest';
import * as Context from './context';
export declare const context: Context.Context;
export declare class GitHub extends Octokit {

should be:

import { Octokit } from '@octokit/rest';

this breaks compilation for me. When I hand edit the package with this change, my project compiles.

This octokit release seems to be related to this issue.

I ended up nuking all my typescript and just using raw node instead, since I couldn't compile using the types supplied by the @actions/github package.

@hardboiled Thanks! That may relate to my PR: #332.

@nwtgck this should be resolved in 2.1.1, I've been unable to reproduce in that version.

I'm going to close this out for now, but if you are still encountering issues please let me know and we can revisit this item.

Thanks for your contribution!

Was this page helpful?
0 / 5 - 0 ratings