               annotation.explicitPage = 1 + await pdf.getPageIndex annotation.explicit[0]
           annotation
       )
-    -> renderTask.cancel()
+    -> try renderTask.cancel()  # suppress pdfjs's error message
   , [page, windowWidth, fit, inView]
 
   onChangePage = (delta) -> (e) ->

      setAnnotationsTransform "scale(#{1/dpiScale},#{1/dpiScale}) matrix(#{scaledViewport.transform.join ','})"
      ## Annotation links, based loosely on
      ## https://stackoverflow.com/a/20141227/7797661
      page.getAnnotations().then (annotationsLoaded) -> setAnnotations(
        for annotation in annotationsLoaded
          if annotation.dest  # local link
            ## Refer to https://github.com/mozilla/pdf.js/blob/master/web/pdf_link_service.js goToDestination & _goToDestinationHelper

    renderTask = page.render
      canvasContext: context
      viewport: scaledViewport
    Promise.all [renderTask.promise, page.getAnnotations()]
    .then ([rendered, annotationsLoaded]) ->
      replaceCanvas canvasRef, canvas
      setRendering false
      ## Clear existing annotations, and load this page's annotations
