FranckFreiburger / vue-pdf

vue.js pdf viewer
MIT License
2.22k stars 520 forks source link

Cannot read properties of undefined (reading 'catch') #334

Open windsonR opened 3 years ago

windsonR commented 3 years ago

rendering error:

vue.esm.js?a026:1906 

       TypeError: Cannot read properties of undefined (reading 'catch')
    at PDFJSWrapper.renderPage (pdfjsWrapper.js?a068:196)
    at VueComponent.resize (componentFactory.js?0d60:75)
    at invokeWithErrorHandling (vue.esm.js?a026:1872)
    at VueComponent.invoker (vue.esm.js?a026:2197)
    at invokeWithErrorHandling (vue.esm.js?a026:1872)
    at VueComponent.Vue.$emit (vue.esm.js?a026:3912)
    at VueComponent.handler (resize-sensor.vue?c7ed:49)
    at invokeWithErrorHandling (vue.esm.js?a026:1872)
    at Watcher.run (vue.esm.js?a026:4593)
    at flushSchedulerQueue (vue.esm.js?a026:4335)

https://github.com/FranckFreiburger/vue-pdf/blob/1a47de972abefd2079a4e23485041f08d9f68aab/src/pdfjsWrapper.js#L196

this pdfRender.cancel() is undefined

environment: vue-pdf: 4.3.0 vue.js: 2.6.14 webpack: 5.50.0 browser: Microsoft Edge 94.0.989.0 and FireFox 93.0a1 os: macos 11.5.2

naimao001 commented 3 years ago

有类似的issue 自己守一下 降版本就行

windsonR commented 3 years ago

有类似的issue 自己守一下 降版本就行

😂😂😂😂😂😂

chenxu1112 commented 3 years ago

"pdfjs-dist": "2.5.207", "vue-pdf": "4.2.0" 锁定这两个版本完美解决

windsonR commented 3 years ago

😂😂😂😂😂😂😂😂😂

操作好骚

flavionobredev commented 2 years ago

sorry for the question... is this fix now available for npm update? thanks

teckel12 commented 1 year ago

As this project seems to be abandoned, I created a fork which corrects this bug. The package can be found here:

https://www.npmjs.com/package/@teckel/vue-pdf