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.

TypeError: Cannot read properties of undefined (reading 'createReview')

See original GitHub issue

I am still in the process of further investigating what could have changed, but I thought I am going to post here in case anyone else has an idea.

As far as we know, nothing changed in the configuration of the token itself or the secret, but suddenly (around 12-24h ago) the setup that we had successfully working for months started failing with:

dependency type: production
security critical: false
config: production:semver:patch
production:semver:patch detected, will auto-merge
Error: Cannot read properties of undefined (reading 'createReview')
TypeError: Cannot read properties of undefined (reading 'createReview')
    at approve ([file:///action/lib/api.js:2:23](https://github.com/ahmadnassri/action-dependabot-auto-merge/blob/master/action/lib/api.js#L2))
    at default (file:///action/lib/index.js:31:11)
    at file:///action/index.js:[53](https://github.com/1debit/dependabot-test/actions/runs/3527941119/jobs/5919738455#step:4:54):7
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25)

The line in question is this:

  await octokit.pulls.createReview({

Which appears to mean that octokit.pulls is undefined, but also that it does not appear to be a permission issue as such with the token since it got that far.

At first I thought that something might have changed on the latest 2.6.1 release from earlier today, but I confirmed that the issue is also still happening with 2.6.0 which as I said before we’ve been using fine for months.

I am also sending this to Github support, but I was wondering whether anyone else has seen this and if yes, whether they found a solution for it.

Thanks in advance.

Issue Analytics

  • State:open
  • Created 10 months ago
  • Reactions:30
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
leezumsteincommented, Nov 24, 2022

Fairly certain you need to use octokit.rest.<api method> now with the latest version, why it’s throwing an undefined error.

I can open a PR in a bit to update this.

1reaction
maciejmakowskicommented, Nov 28, 2022

@mknepprath looking at your PR (https://github.com/mknepprath/mknepprath-next/pull/976), you probably want to go back to @2 now again, otherwise you’ll get stuck on 2.6.2 or will have to continue to update it manually, unlike with @2 where you get update automatically.

Alternatively, you can also set up Dependabot to update your Github Actions too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read properties of undefined (reading 'create')
TypeError : Cannot read properties of undefined (reading 'create') at /script.js:12:21. Here is my code. let Engine x=document.
Read more >
typeerror: cannot read properties of undefined (reading 'secret')
It seems you must have selected something other than OAuth while generating the credentials. So as per the steps your config file should...
Read more >
Why is the error "Cannot read properties of undefined (reading ...
I'm building a LWC to be used as a flow screen component. In the LWC, I allow the border color of the component...
Read more >
TypeError: Cannot read properties of undefined (re...
my client script.
Read more >
How to Prevent the Error: Cannot Read Property '0' of Undefined
js, you should see TypeError: Cannot read properties of undefined (reading '0') . Leaving this error unchecked can be very detrimental to the ......
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