501351981 / vue-office

支持word(.docx)、excel(.xlsx,.xls)、pdf、pptx等各类型office文件预览的vue组件集合,提供一站式office文件预览方案,支持vue2和3,也支持React等非Vue框架。Web-based pdf, excel, word, pptx preview library
https://501351981.github.io/vue-office/examples/docs/
MIT License
4.08k stars 471 forks source link

when i builded my project, I found my dist cann't normal operation in the formal environment. throw away this mistake: "Cannot access 'e' before initialization" #354

Open lzq-dingyuan opened 2 months ago

lzq-dingyuan commented 2 months ago

1.组件名称及版本: I don't sure which is wrong.
"@vue-office/docx": "^1.6.0", "@vue-office/excel": "^1.7.6", "@vue-office/pdf": "^2.0.1", 2.运行环境: 浏览器:google chrome vue版本:vue@3.3.4 打包工具及版本:如vite@4.4.5 3.问题描述: Cannot access 'e' before initialization at @vue-office-b87c0214.js:12:170638 image

lzq-dingyuan commented 2 months ago

最后解决方法是在vite.config.js中添加 commonjsOptions: { requireReturnsDefault: 'namespace' },