                 @_show() # update layout, since hiding spinner might cause a linebreak in the button bar to go away
                 opts.cb?()
 
-    render_error_page: () =>
+    render_error_page: (cb) =>
         log = @preview.pdflatex.last_latex_log
         if not log?
+            cb()
             return
         p = (new LatexParser(log)).parse()
 

            cb?()

    _show_error_in_preview: (mesg) =>
        if @preview.pdflatex.filename_tex == mesg.file
            @_show_error_in_file mesg, () =>
                @show_page('png-preview')
                @forward_search(active:true)

    render_error_message: (mesg) =>
        if not mesg.line

        @element = templates.find(".salvus-editor-latex").clone()

        @_pages = {}
        @_rnw_concordance = null

        # initialize the latex_editor
        @latex_editor = editor.codemirror_session_editor(@project_id, @filename, opts)
