[Tex/LaTex] Beamer – ! File ended while scanning use of \next

beamererrors

I ran into an issue with the following code

\begin{document}


    \begin{frame}[fragile] % Start of frame

        \begin{columns}[t]

            \begin{column}{.02\textwidth}\end{column} % Empty spacer column

            \begin{column}{.465\textwidth} % The first column


                \begin{block}

                    \begin{minted}{c}
                        int main() {
                            return 0;
                        }
                    \end{minted}

                \end{block}
            \end{column}

        \end{columns}
    \end{frame} % End of frame
\end{document}

With the following error

Runaway argument?
! File ended while scanning use of \next.
<inserted text> 
            \par 

I'm putting my solution here because I wasted hours trying to figure out what went wrong with such a cryptic error message

Best Answer

The fix was 2-part

  • \end{frame} can NOT be indented
  • \end{frame} cannot have any comments directly after it

Changing this line fixed the error.