Skip to content

[bug] Invalid line number XXX in 21-line document #368

Closed

Description

@OpenCode

Describe the bug

A few times, clicking on a search result I get this error.

Image

The error may occur with parts of file code that do not give the same problem in other places

To reproduce

It seems random

Sourcebot deployment information

Sourcebot v4.5.0
Local hosting
Docker
Debian

Additional information

No response

Activity

  1. msukkari commented on Jun 30, 2025

    @msukkari
    Contributor

    Hey @OpenCode, is there any additional client console logs you could share? Also, does this issue repro 100% of the time for a specific search -> search result press?

  2. OpenCode commented on Jul 2, 2025

    @OpenCode
    Author

    Hey @OpenCode, is there any additional client console logs you could share? Also, does this issue repro 100% of the time for a specific search -> search result press?

    It happens with the same search but not to every result of the same search

    Image

    RangeError: Invalid line number 974 in 21-line document
        NextJS 11
    1080-8e9944c494226fa5.js:1:4433
        NextJS 103
    
  3. msukkari commented on Jul 3, 2025

    @msukkari
    Contributor

    There's likely some character/symbol in the underlying file here that is causing this. Any chance you have a publicly accessible file that repro's this issue you can share?

  4. OpenCode commented on Jul 4, 2025

    @OpenCode
    Author

    There's likely some character/symbol in the underlying file here that is causing this. Any chance you have a publicly accessible file that repro's this issue you can share?

    I can share a screenshot but not the repo (it's private)

  5. msukkari commented on Jul 4, 2025

    @msukkari
    Contributor

    @OpenCode if you could share that info over email that will help us repro this!

  6. brendan-kellam commented on Jan 16, 2026

    @brendan-kellam
    Contributor

    Hey @OpenCode - I shipped a fix in #745. The issue was that a out of bounds highlight range was being used (in your screenshot, it was attempting to highlight from line 989 in a 21 line document..). The fix adds defensive checks for this and issues a console warning instead of just completely crashing.

    As to why you were hitting this, I'm not totally certain. It would still be helpful to get to the root cause of this, so if you could share more details, please shoot us a email at support@sourcebot.dev. Cheers

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions