Error `gh: Field 'projectItems' doesn't exist on type 'PullRequest'` when viewing/editing PRs
Issue Description
Type: bug report
Describe what happened (or what feature you want)
When running Octo pr list or Octo pr edit <number>, I get the following error message: gh: Field 'projectItems' doesn't exist on type 'PullRequest'. The PR buffer is then blank and I can't do anything with the PR. This also occurs when calling Octo pr list and occurs again each time I arrow-key between the PRs in the list.
Describe what you expected to happen
PR data to be visible in the PR edit buffer and no errors to be thrown
How to reproduce it (as minimally and precisely as possible)
- Call
Octo pr listorOcto pr edit <number>
Tell us your environment
Versions
gh: 2.45.0octo.nvim:master@1e2376anvim: 0.9.5- MacOS: 14.3.1
Anything else we need to know?
It worked briefly when I first installed/configured it, but then seemingly has stopped.
Please try setting default_to_projects_v2 = false in the configuration. Seems like you are using projects v2 which may be causing this problem
@pwntester hmm... I'm using Lazy and this is my config:
{
"pwntester/octo.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
"nvim-tree/nvim-web-devicons",
},
cmd = "Octo",
config = function()
require("octo").setup({
default_to_projects_v2 = false,
})
end,
},
Still getting the same error with that option set.
Im a bit puzzled on this one. The error you are receiving is from gh so it is the GitHub backend the one saying that this property does not exist on the PullRequest object. Are you using GitHub Enterprise? If thats the case, your GHES version may be old and not support projects v2. Anyway, this PR should fix the issue. Let me know if it works for you
@pwntester thank you! Yeah, the project is in GHE. I'm actually noticing that it may be an issue with gh itself and how it handles auth? e.g. if I do gh pr checkout 123 in a GHE project, it requests auth via 1password. After I've authenticated through 1p, the command just hangs indefinitely until I ctrl+c it. Then if I run it again, it runs as expected (since I'm authenticated already).
I'll give that PR a shot!