Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

octokit.issues.create didn't work for me. Error Cannot read property 'create' of undefined #36

Open

Description

@boanders74

The lesson says to use this code
const github = require("@actions/github");
const octokit = new github.getOctokit(token);
const newIssue = await octokit.issues.create({

but the create seemed to always fail with this error below.

image

I found online someone that used this and that seemed to work for me
const newIssue = await octokit.rest.issues.create({

Activity

  1. markpatterson27 commented on Jul 6, 2021

    @markpatterson27
    Contributor

    I had this issue too. v5.0.0 of @actions/github seems to have added .rest to the method call. (presumably this is due to a change in octokit/rest.js, but I didn't look that up)

  2. gessnersn commented on Sep 20, 2021

    @gessnersn
    Contributor

    +1 stumbled into the same issue today

  3. jckling commented on Apr 1, 2022

    @jckling

    Same problem, have to add .rest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions