Skip to content

DOCXKIT_PREVIEW_INPUT_INVALID: 預覽輸入無效 ​

預覽輸入缺失,或類型不受支援。

修復步驟 ​

  1. 傳入 DOCX Blob、ArrayBuffer、Uint8Array 或 URL。
  2. 生成完成後再開始預覽。

問題範例 ​

ts
// Invalid external input:
const input = null

修復範例 ​

ts
import { createDocx, createDocxPreview } from 'docx-kit'

const container = document.createElement('div')
document.body.append(container)

const preview = createDocxPreview(container)
try {
  await preview.render(await createDocx().p('Hello').toBlob())
} finally { preview.destroy() }

常見原因 ​

  • 傳入 null,或不支援的物件、字串類型。

診斷欄位 ​

訊息範例 ​

text
Unsupported preview input type

原始碼與相關指南 ​

Released under the MIT License.