vue-pdf组件报错vue-pdf Cannot read properties of undefined (reading ‘catch‘)
vue-pdf
vue.js pdf viewer
项目地址:https://gitcode.com/gh_mirrors/vu/vue-pdf
·
项目场景:
使用vue-pdf组件实现文件预览功能
问题描述:
安装依赖后报错vue-pdf Cannot read properties of undefined (reading 'catch')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)
解决方案:
看了很多方法,最后锁定依赖版本解决报错问题。
①在根目录下输入一下命令
npm i pdfjs-dist@2.5.207
npm i vue-pdf@4.2.0
②修改pacakge.json文件
"pdfjs-dist": "2.5.207",
"vue-pdf": "4.2.0"
修改完重新启动项目,就没有再出现报错问题了。
附原文参考链接:https://www.cnblogs.com/thinkingthigh/p/15661288.html
vue.js pdf viewer
最近提交(Master分支:2 个月前 )
a9f01b23 - 1 年前
c188a043
add open_collective vue-pdf 1 年前
新一代开源开发者平台 GitCode,通过集成代码托管服务、代码仓库以及可信赖的开源组件库,让开发者可以在云端进行代码托管和开发。旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。
更多推荐


所有评论(0)