# GitLens error: Element with id gitlens://searchAndCompare/compare-results/comparison/+origin/main is already registered

**URL:** <https://forum.cursor.com/t/gitlens-error-element-with-id-gitlens-searchandcompare-compare-results-comparison-origin-main-is-already-registered/132687>\
**Category:** Bug Reports\
**Created:** [September 5, 2025, 11:30am UTC](https://forum.cursor.com/t/gitlens-error-element-with-id-gitlens-searchandcompare-compare-results-comparison-origin-main-is-already-registered/132687 "2025-09-05T11:30:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jimbotron](https://avatars.discourse-cdn.com/v4/letter/j/aca169/32.png) [@Jimbotron](https://forum.cursor.com/u/Jimbotron)\
**Post date:** [September 5, 2025, 11:30am UTC](https://forum.cursor.com/t/gitlens-error-element-with-id-gitlens-searchandcompare-compare-results-comparison-origin-main-is-already-registered/132687/1 "2025-09-05T11:30:43Z")

</div>

### Where does the bug appear (feature/product)?

Cursor IDE

### Describe the Bug

When I try to compare branches with the GitLens extension I get an error:

Element with id gitlens://searchAndCompare/compare-results/comparison/+origin/main is already registered

I’ve tried disabling all other extensions. I’ve also tried the same repo in VS Code and GitLens doesn’t error.

### Steps to Reproduce

I can’t share my repo to not sure what to suggest…?

### Operating System

MacOS

### Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.5.9  
VSCode Version: 1.99.3  
Commit: de327274300c6f38ec9f4240d11e82c3b0660b20  
Date: 2025-08-30T21:02:27.236Z  
Electron: 34.5.8  
Chromium: 132.0.6834.210  
Node.js: 20.19.1  
V8: 13.2.152.41-electron.0  
OS: Darwin arm64 24.6.0

### Does this stop you from using Cursor

No - Cursor works, but with this issue

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [September 27, 2025, 10:36am UTC](https://forum.cursor.com/t/gitlens-error-element-with-id-gitlens-searchandcompare-compare-results-comparison-origin-main-is-already-registered/132687/2 "2025-09-27T10:36:03Z")

</div>

Hey, please update to version 1.6 and let me know if the issue still persists.

---

<div class="post-metadata">

**Author:** ![Jimbotron](https://avatars.discourse-cdn.com/v4/letter/j/aca169/32.png) [@Jimbotron](https://forum.cursor.com/u/Jimbotron)\
**Post date:** [September 28, 2025, 10:35pm UTC](https://forum.cursor.com/t/gitlens-error-element-with-id-gitlens-searchandcompare-compare-results-comparison-origin-main-is-already-registered/132687/3 "2025-09-28T22:35:42Z")

</div>

I’m on version 1.6.45 but the issue is still there.

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [September 29, 2025, 4:23am UTC](https://forum.cursor.com/t/gitlens-error-element-with-id-gitlens-searchandcompare-compare-results-comparison-origin-main-is-already-registered/132687/4 "2025-09-29T04:23:08Z")

</div>

It looks like this issue is specific to the GitLens extension. Here are similar errors. You can try switching to the pre-release version as a workaround.

> <https://github.com/gitkraken/vscode-gitlens/issues/3442>
>
> \### Description
> 
> To repro, use a command like "compare to/with ..." on a commit/…branch on the graph or branches view while the Search & Compare view is closed/minimized/hidden.
> 
> It will open the comparison but then immediately it will vanish, with the error "element with id already registered". Refreshing the Search & compare view fixes the issue and the comparison shows correctly.
> 
> \### GitLens Version
> 
> 2024.8.205 (pre-release)
> 
> \### VS Code Version
> 
> \_No response\_
> 
> \### Git Version
> 
> \_No response\_
> 
> \### Logs, Screenshots, Screen Captures, etc
> 
> \_No response\_

> <https://github.com/gitkraken/vscode-gitlens/issues/3862>
>
> \### Description
> 
> From the \*\*Source Control\*\* tab try to expand a branch
> Sometime…s the branch tries to load and after a short time it will throw an error saying that :
> \`Element with id gitlens://viewnode/compare-branch/repo//Users/"user"/projects/"project"/branch//Users/"user"/projects/"project"|heads/main is already registered\`
> 
> \### GitLens Version
> 
> 16.0.5
> 
> \### VS Code Version
> 
> Version: 1.96.0
> Commit: 138f619c86f1199955d53b4166bef66ef252935c
> Date: 2024-12-11T02:29:09.626Z
> Electron: 32.2.6
> ElectronBuildId: 10629634
> Chromium: 128.0.6613.186
> Node.js: 20.18.1
> V8: 12.8.374.38-electron.0
> OS: Darwin arm64 24.0.0
> 
> \### Git Version
> 
> git version 2.39.5 (Apple Git-154)
> 
> \### Logs, Screenshots, Screen Captures, etc
> 
> !\[Image\](https://github.com/user-attachments/assets/929640fb-2a59-4acb-9c8c-fe86e4ec1381)

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [October 21, 2025, 4:23am UTC](https://forum.cursor.com/t/gitlens-error-element-with-id-gitlens-searchandcompare-compare-results-comparison-origin-main-is-already-registered/132687/5 "2025-10-21T04:23:32Z")

</div>

Closed on October 21, 2025, 4:23am UTC

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.
