Skip to content

fix: throw a readable error for out-of-range block annotations - #539

Open
BetterAndBetterII wants to merge 1 commit into
code-hike:nextfrom
BetterAndBetterII:fix/annotation-out-of-range-error
Open

fix: throw a readable error for out-of-range block annotations#539
BetterAndBetterII wants to merge 1 commit into
code-hike:nextfrom
BetterAndBetterII:fix/annotation-out-of-range-error

Conversation

@BetterAndBetterII

Copy link
Copy Markdown

Summary

Fixes #486. Out-of-range block annotations (// !mark(100)) crashed in applyBlockAnnotation with Cannot read properties of undefined (reading 'range') when no lines matched. Throw a readable error that names the annotation and the available line count instead.

Test plan

  • cd packages/codehike && npx vitest run src/code/lines.test.ts (RED TypeError → GREEN message)
  • Existing extract-annotations tests still pass

@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

@BetterAndBetterII is attempting to deploy a commit to the codehike Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better error when annotation is out of range

1 participant