Error messages in console using QPdfviewer



  • Currently installed QPdfviewer v1.0.0-beta.5

    Used example code from https://github.com/quasarframework/app-extension-qpdfviewer

    <div class="container q-pa-sm">
      <q-pdfviewer
        v-model="showPdf"
        :src="currentPdf"
        type="html5"
        content-class="fit container"
        inner-content-class="fit container"
      />
    </div>
    
    ...
    
    <style scoped>
      .container {
        max-width: 100%;
        max-height: 100%;
        min-width: 400px;
        min-height: 600px;
        width: 94vw;
        height: 75vh;
      }
    </style>
    

    PDF is shown as it should be.

    Got this console output:

    [Vue warn]: Error in v-on handler: "TypeError: handler.apply is not a function"
    
    found in
    
    ---> <QPdfviewer>
    
    ...
    
    TypeError: "handler.apply is not a function"
        VueJS 3
            invokeWithErrorHandling
            invoker
            _wrapper
    vue.runtime.esm.js:1888
        VueJS 6
            logError
            globalHandleError
            handleError
            invokeWithErrorHandling
            invoker
            _wrapper
    
    ...
    
    offsetParent is not set -- cannot scroll viewer.js:2538:13
        scrollIntoView resource://pdf.js/web/viewer.js:2538
        _scrollIntoView resource://pdf.js/web/viewer.js:8801
        _scrollIntoView resource://pdf.js/web/viewer.js:8273
        _resetCurrentPageView resource://pdf.js/web/viewer.js:8915
        _setCurrentPageNumber resource://pdf.js/web/viewer.js:8478
        scrollPageIntoView resource://pdf.js/web/viewer.js:8937
        _setScaleUpdatePages resource://pdf.js/web/viewer.js:8836
        _setScale resource://pdf.js/web/viewer.js:8904
        set currentScaleValue resource://pdf.js/web/viewer.js:8551
        setInitialView resource://pdf.js/web/viewer.js:1348
        load resource://pdf.js/web/viewer.js:1114
    


  • @SB
    A couple of things I noticed:

    1. There is an error is on your v-on handler (ie: :)
    2. type="html5" but the second window is showing PDFjs and not the HTML5 viewer.

    What OS, browser and all that?



  • @Hawkeye64
    Windows 10 Version 1809

    Same on Firefox 70.0.1 and Chromium 78.0.3904.108



  • quasar 1.5.1 / quasar/app1.3.1



  • @Hawkeye64
    Here are some additional infos:

    There was an older version of QPdfviewer installed in my project.
    After reading your hints on installing QPdfviewer in this case I performed uninstall and re-install of QPdfviewer.
    This didn’t solve the problem.



  • @Hawkeye64

    After removing yarn.lock, node_modules and yarn install I still got the same error messages.

    quasar v1.5.3 / quasar/app v1.3.1



  • @Hawkeye64

    I created a new project with quasar create <project>.
    Then I added QPdfviewer with quasar ext add @quasar/qpdfviewer.
    Still the same.

    quasar v1.5.4 / quasar/app v1.3.3


Log in to reply