501351981 / vue-office

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

部分.docx文档无法预览 #200

Open AnnCY1 opened 9 months ago

AnnCY1 commented 9 months ago

error事件报错信息如下:

TypeError: Cannot read properties of null (reading 'localName')
    at index-5e7d05b0.js:82:11302
    at x.foreach (index-5e7d05b0.js:82:24348)
    at e.DocumentParser.parseRun (index-5e7d05b0.js:82:11247)
    at e.DocumentParser.parseParagraph (index-5e7d05b0.js:82:9929)
    at e.DocumentParser.parseBodyElements (index-5e7d05b0.js:82:5151)
    at e.DocumentParser.parseDocumentFile (index-5e7d05b0.js:82:4842)
    at m.parseXml (index-5e7d05b0.js:82:31328)
    at m.<anonymous> (index-5e7d05b0.js:82:1386)
    at Generator.next (<anonymous>)
    at P (index-5e7d05b0.js:1:2091)

bug定位似乎在这里: 22

无法正常预览的文件: 通知.docx 通知(第二人称).docx 公文版式-版记.docx

项目用的是 vue3 + vite + TS + vue-office/docx (^1.3.2版本)

packagejson文件:

"dependencies": {
        "@element-plus/icons-vue": "^2.1.0",

        "@vue-office/docx": "^1.3.2",

        "echarts": "^5.4.3",
        "element-plus": "^2.3.9",
        "file-saver": "^2.0.5",
        "markdown-it": "^13.0.2",
        "pinia": "^2.1.4",
        "pinia-plugin-persistedstate": "^3.2.0",
        "qrcode": "^1.5.3",
        "recorder-core": "^1.2.23070100",
        "sse.js": "^1.0.0",
        "vue": "^3.3.4",
        "vue-router": "^4.2.4",
        "vue3-editor": "^0.1.1",
        "vue3-video-play": "1.3.1-beta.6",
        "vuedraggable": "^4.1.0"
    },
    "devDependencies": {
        "@rushstack/eslint-patch": "^1.3.2",
        "@tsconfig/node18": "^18.2.0",
        "@types/file-saver": "^2.0.6",
        "@types/node": "^18.17.0",
        "@types/qrcode": "^1.5.4",
        "@vitejs/plugin-vue": "^4.2.3",
        "@vue/eslint-config-prettier": "^8.0.0",
        "@vue/eslint-config-typescript": "^11.0.3",
        "@vue/tsconfig": "^0.4.0",
        "axios": "^1.4.0",
        "eslint": "^8.45.0",
        "eslint-plugin-vue": "^9.18.1",
        "npm-run-all": "^4.1.5",
        "prettier": "^3.0.3",
        "sass": "^1.65.1",
        "typescript": "~5.1.6",
        "unplugin-auto-import": "^0.16.6",
        "unplugin-vue-components": "^0.25.1",
        "vite": "^4.4.6",
        "vite-plugin-svg-icons": "^2.0.1",
        "vue-tsc": "^1.8.6"
    }
lexmin0412 commented 3 weeks ago

Same Problem.