Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Vue warn]: Error in callback for watcher "pdf": "TypeError: pdf.getPage is not a function" #34

Open
gwynncausing opened this issue Mar 9, 2021 · 3 comments

Comments

@gwynncausing
Copy link

No description provided.

@Raneto4ka
Copy link

I have the same error. @gwynncausing have you solved it?

@gwynncausing
Copy link
Author

It still gives me an error

@Uraharadono
Copy link

Uraharadono commented Jun 18, 2021

Having exactly the same issue along with other messages:

EDIT: I figured that in my app in PDFData.vue -> function getPages(pdf, first, last), for value of variable pdf I am getting PDFDocumentLoadingTask and in this repo it is PDFDocumentProxy

Showing them here top to bottom from console:

Message 0:

vue.runtime.esm.js:1896 TypeError: Cannot read property 'scrollTop' of undefined
    at VueComponent.updateScrollBounds (ScrollingDocument.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options:97)
    at scroll (methods.js:167)
    at callHook$1 (vue.runtime.esm.js:6714)
    at _update (vue.runtime.esm.js:6635)
    at Array.updateDirectives (vue.runtime.esm.js:6616)
    at invokeCreateHooks (vue.runtime.esm.js:6103)
    at createElm (vue.runtime.esm.js:5990)
    at VueComponent.patch [as __patch__] (vue.runtime.esm.js:6511)
    at VueComponent.Vue._update (vue.runtime.esm.js:3954)
    at VueComponent.updateComponent (vue.runtime.esm.js:4075)

This one is shown 2 times, and I figured that issue is in the ScrollingDocument.vue -> updateScrollBounds method, where code
const {scrollTop, clientHeight} = this.$el; is causing it cause this.$el is undefined.

Message 1:

vue.runtime.esm.js:620 [Vue warn]: Error in callback for watcher "pdf": "TypeError: pdf.getPage is not a function"

found in

---> <PDFData> at src/components/Pdf/PDFData.vue
       <PDFViewer> at src/components/Pdf/PDFViewer.vue
         <QuotationOverview> at src/views/Quotation/Public/ClientQuotationOrderOverview.vue
           <App> at src/App.vue
             <Root>

Message 2:

vue.runtime.esm.js:1896 TypeError: pdf.getPage is not a function
    at eval (PDFData.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options:84)
    at Array.map (<anonymous>)
    at getPages (PDFData.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options:83)
    at VueComponent.fetchPages (PDFData.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options:159)
    at VueComponent.pdf (PDFData.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options:138)
    at invokeWithErrorHandling (vue.runtime.esm.js:1862)
    at Watcher.run (vue.runtime.esm.js:4578)
    at flushSchedulerQueue (vue.runtime.esm.js:4320)
    at Array.eval (vue.runtime.esm.js:1988)
    at flushCallbacks (vue.runtime.esm.js:1914)

Message 3:

Uncaught ReferenceError: window is not defined at pdf.worker.js:1

This is really bugging me for some time now, and I only copy/pasted source files from this repo to mine, and also installed libraries that are in package.josn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants