bensadeh / circumflex

🌿 It's Hacker News in your terminal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

panic: runtime error: slice bounds out of range

bensadeh opened this issue · comments

I have this issue after installing today. It worked a few seconds then this happened. possibly after a resize of the window.

panic: runtime error: slice bounds out of range [:37] with capacity 0

goroutine 66 [running]:
clx/hn/services/hybrid.(*Service).FetchItems(0x0?, 0x24, 0x0?)
	/home/runner/work/circumflex/circumflex/hn/services/hybrid/hybrid.go:30 +0x4ac
clx/bubble/list.(*Model).FetchFrontPageStories.func1()
	/home/runner/work/circumflex/circumflex/bubble/list/list.go:114 +0x88
github.com/charmbracelet/bubbletea.(*Program).StartReturningModel.func6.1()
	/home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea@v0.22.1/tea.go:469 +0x38
created by github.com/charmbracelet/bubbletea.(*Program).StartReturningModel.func6
	/home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea@v0.22.1/tea.go:467 +0x11c
❯ stty size
40 127

Originally posted by @matthiasg in #3 (comment)

Hi @matthiasg, I am creating a new issue for this panic since I had pretty much changed the whole TUI backend since the original issue first occurred.

It disappears sometimes and then comes back. Could not find a good way to replicate yet

After installation, I get this message every time.

I'm running the Monterey 12.6.

Thanks for reporting this panic. Right now I am not able to reproduce this error, but for 2.7 I am going to add an option for logging to a file to make it easier to debug and reproduce the issue.

@bensadeh Turns out I was blocking all outbound connections to firebaseio.com. Once I whitelisted hacker-news.firebaseio.com, it worked.

@nickali Glad you found the root cause! Now that I know more about the issue, I can add better error messages for this type of error.

@matthiasg I'm going to close this ticket for now, please re-open if the issue persist or you find a way to reproduce.