vscode-pull-request-github icon indicating copy to clipboard operation
vscode-pull-request-github copied to clipboard

"Pull Requests" and "Issues" have been showing "loading..." for hours

Open sabo28 opened this issue 5 years ago • 26 comments

  • VS Code Version: 1.54.2
  • OS Version: 10.0.19042 Build 19042

Steps to Reproduce:

  1. Install GitHub Pull Requests and Issues in VSCode
  2. Authorize with Github
  3. Go to the Github Section with the tab on the left side
  4. Pull Requests and Issues have been showing "loading..." for hours

Does this issue occur when all extensions are disabled?: No

sabo28 avatar Mar 14 '21 18:03 sabo28

@labo28 Can you open the developer tools by running the command "Developer: Toggle Developer Tools" and check for any errors in the console? It sounds like the extension is not activating

RMacfarlane avatar Mar 15 '21 01:03 RMacfarlane

I have the same issue and see the 2 warnings and 2 errors below in the Developer console:

workbench.desktop.main.js:62 [Extension Host] rejected promise not handled within 1 second: Error: Git model not found v @ workbench.desktop.main.js:62

workbench.desktop.main.js:62 [Extension Host] stack trace: Error: Git model not found at a.getAPI (c:\Users\User\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\git\dist\main.js:54:45368) at new Da (c:\Users\User.vscode\extensions\github.vscode-pull-request-github-0.24.0\dist\extension.js:1008:18628) at Function.createProvider (c:\Users\User.vscode\extensions\github.vscode-pull-request-github-0.24.0\dist\extension.js:1008:19195) at Dp (c:\Users\User.vscode\extensions\github.vscode-pull-request-github-0.24.0\dist\extension.js:1008:25145) at Eg (c:\Users\User.vscode\extensions\github.vscode-pull-request-github-0.24.0\dist\extension.js:1020:23211) at processTicksAndRejections (internal/process/task_queues.js:97:5) v @ workbench.desktop.main.js:62

workbench.desktop.main.js:2084 [[object Object]]Git model not found $onExtensionRuntimeError @ workbench.desktop.main.js:2084

workbench.desktop.main.js:2084 Error: Git model not found at a.getAPI (c:\Users\User\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\git\dist\main.js:54:45368) at new Da (c:\Users\User.vscode\extensions\github.vscode-pull-request-github-0.24.0\dist\extension.js:1008:18628) at Function.createProvider (c:\Users\User.vscode\extensions\github.vscode-pull-request-github-0.24.0\dist\extension.js:1008:19195) at Dp (c:\Users\User.vscode\extensions\github.vscode-pull-request-github-0.24.0\dist\extension.js:1008:25145) at Eg (c:\Users\User.vscode\extensions\github.vscode-pull-request-github-0.24.0\dist\extension.js:1020:23211) at processTicksAndRejections (internal/process/task_queues.js:97:5) $onExtensionRuntimeError @ workbench.desktop.main.js:2084

saitozturk avatar Mar 16 '21 10:03 saitozturk

I have been observing the same problem for 2 days :eyes:

screen

image

andrejsharapov avatar Mar 23 '21 17:03 andrejsharapov

I have the same issue. Logs are mostly the same as for @saitozturk image

BobcatProgrammer avatar Apr 09 '21 12:04 BobcatProgrammer

I just noticed its working in another repo with a different set of extensions activated. After testing this I have verified it has to do with the sonarsource.sonarlint-vscode extension. When the extension is enabled Github Pull Request Extension doesn't load with above error. If I deactivate sonarlint it works without problems.

Is this caused by SonarLint or Github PR? Should I open an issue with SonarLint as well?

BobcatProgrammer avatar Apr 09 '21 12:04 BobcatProgrammer

Same error to me

image

I uninstalled and installed it again. The section tloaded. However, it was unable to check out to a PR branch>

image

lucasrodes avatar Apr 28 '21 10:04 lucasrodes

UPDATE

Apparently the fetch field in "origin" section in .git/config file was wrongly set. It should look like:

✅✅

[remote "origin"]
	url = https://github.com/[user]/[project].git
	fetch = +refs/heads/*:refs/remotes/origin/*

Previously I had:

❌❌

[remote "origin"]
	url = https://github.com/[user]/[project].git
	fetch = +refs/heads/master:refs/remotes/origin/master

lucasrodes avatar Apr 28 '21 11:04 lucasrodes

the fix proposed by @lucasrodes does not work for me unfortunately... Also disabling other Extensions above seems to have been a race condition... Its now back to not working at all.

BobcatProgrammer avatar Apr 28 '21 13:04 BobcatProgrammer

Any solutions. I got the same problem. Endless loading......

ghost avatar Apr 29 '21 17:04 ghost

I might have found the root cause for this. The Extensions depends on the vscode.git extension but it never declares that anywhere. And therefore sometimes fails if the Git extensions is not loaded in time. This also explains my race condition above that removing extension "fixed" it. This changed the startup order enough to have vscode.git ready before the github extension loaded. Based on the Extension Docs I added following snippet to the package.json of the extension in my local .vscode/extensions folder

{
// ....
	"extensionDependencies": [
		"vscode.git"
	],
// ....
}

This seems to have fixed the issue for me... will keep on testing. Can anybody confirm this?

Also happy to do a PR for this. (shouldn't be too hard adding all of 3 lines 😄 )

BobcatProgrammer avatar May 02 '21 11:05 BobcatProgrammer

It looks like there are two separate issues here:

  1. If Git is not installed, the git extension throws an error when we try to access the API and we don't gracefully handle this
  2. The git extension is not activating at some times

Adding the vscode.git extension as an extension dependency doesn't actually make VS Code try to activate it before this extension, I think we need to make an explicit call to activate

RMacfarlane avatar May 12 '21 17:05 RMacfarlane

Is there a way to fix this issue as Im encountering it?

itsrigo avatar Jul 15 '21 20:07 itsrigo

In case this helps anyone else, for me the following fixed this issue.

  1. Quit vscode
  2. rm -rf ~/.vscode/extensions/github.vscode-pull-request-github-*
  3. Start vscode
  4. Reinstall the extension, and reauth to GitHub in browser

justindotpub avatar Oct 20 '21 17:10 justindotpub

Hello, I am suffering from this situation and I do not see any error. How can I debug this?

JoaoPedroAlex avatar Feb 08 '22 19:02 JoaoPedroAlex

Hello, I am suffering from this situation and I do not see any error. How can I debug this?

I was having the same issue and after much digging I was able to find the problem. What did you name your remote repo in vscode? Run the following command in the terminal in the same location as the git folder:

git remote -v

You should see the name on the left hand side. If it is not named origin/upstream the extension will not work. Looking at the extension settings, you can see that is what it is looking for:

image

To fix the issue, you have to add origin

git remote add origin https://github.com/<account>/<repo>

Alternatively, in the extension settings, you can add the name of your remote so that it knows to also look for the remote repo that came up when the above command was sent.

milunova avatar Feb 22 '22 18:02 milunova

I don't know why @milunova's comment is marked as outdated, but this fixed it for me. I had named my new remote "github" and not "origin", and then this happened without me thinking about it. I just added github to the list of PR: Remotes and it worked straight away.

wlgrd avatar Aug 05 '22 10:08 wlgrd

Is there someone who fixed this problem? pls help me.

As I mentioned, the below reply worked for me.

Hello, I am suffering from this situation and I do not see any error. How can I debug this?

I was having the same issue and after much digging I was able to find the problem. What did you name your remote repo in vscode? Run the following command in the terminal in the same location as the git folder:

git remote -v

You should see the name on the left hand side. If it is not named origin/upstream the extension will not work. Looking at the extension settings, you can see that is what it is looking for:

image

To fix the issue, you have to add origin

git remote add origin https://github.com/<account>/<repo>

Alternatively, in the extension settings, you can add the name of your remote so that it knows to also look for the remote repo that came up when the above command was sent.

wlgrd avatar Aug 11 '22 12:08 wlgrd

hy ...I am facing same issue , please help

abdulmoizniazi avatar Aug 30 '22 08:08 abdulmoizniazi

@abdulmoizniazi did you try looking at the solutions?

wlgrd avatar Aug 30 '22 10:08 wlgrd

I'm having this issue too but none of the solutions have worked. I'm on SSO enterprise

fseminario avatar Sep 07 '22 17:09 fseminario