Skip to content

pr-base-commit - Fix TypeError on PRs with conflicts - #9880

Merged
fregante merged 1 commit into
refined-github:mainfrom
mmustafasenoglu:fix/pr-base-commit-conflict-span
Jul 25, 2026
Merged

fregante merged 1 commit into
refined-github:mainfrom
mmustafasenoglu:fix/pr-base-commit-conflict-span

Conversation

@mmustafasenoglu

Copy link
Copy Markdown
Contributor

Closes #9853

Problem

On PRs with merge conflicts, GitHub wraps the mergeability message in a span instead of a plain text node. The feature calls isTextNodeContaining on firstChild which throws when it hits that span.

Fix

Added an instanceof Text check before calling isTextNodeContaining, so the "Merging can be performed automatically" text removal is skipped when the node is not a text node.

Test URLs

When a PR has merge conflicts, GitHub wraps the mergeability message
in a span element instead of a plain text node. The feature assumed
a text node and threw a TypeError.

This adds an instanceof Text guard so the removal is only attempted
on actual text nodes, matching fregante's suggested fix.

Closes #9853

Signed-off-by: Mustafa Şenoğlu <[email protected]>
@github-actions github-actions Bot added the bug label Jul 24, 2026
@github-actions github-actions Bot changed the title pr-base-commit: Fix TypeError on conflicting PRs pr-base-commit: Fix TypeError on conflicting PRs Jul 24, 2026
@fregante fregante changed the title pr-base-commit: Fix TypeError on conflicting PRs pr-base-commit - Fix TypeError on PRs with conflicts Jul 24, 2026
@fregante
fregante merged commit 26e7983 into refined-github:main Jul 25, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

pr-base-commit: Expected Text node, received SPAN

3 participants