A long build scrolled past and now the error is off the top of the screen. Scrolling back with the mouse is slow. Let tmux hand you the text.
capture-pane copies the contents of a pane. With -p the output goes to stdout instead of a tmux buffer, so you can pipe it. -S and -E pick the start and end line, and a negative number reaches into the scrollback; -S - starts at the very beginning of the history.
tmux capture-pane -p -S - | grep -n 'error'
tmux capture-pane -p -S -200 > last200.txt
Add -J to join wrapped lines and keep trailing spaces, so a long line is not cut in two at the edge of the window. Use -t to name another pane or session.
The caveat: you only get what tmux still has. The history limit defaults to 2000 lines, so older output is gone unless you raised history-limit in your config. A change there only applies to new panes. And colors are dropped unless you add -e, which is usually what you want for grepping.
Further reading: tmux(1) man page, On this site: tmux capture-pane -p dumps a pane's scrollback to a file, On this site: in tmux copy mode, / searches forward and ? searches backward