Skip to content

DOCXKIT_PREVIEW_INPUT_INVALID: Invalid preview input ​

The preview input is absent or not one of the supported input types.

What to do ​

  1. Pass a DOCX Blob, ArrayBuffer, Uint8Array, or URL.
  2. Wait for generation to finish before starting preview.

Problem example ​

ts
// Invalid external input:
const input = null

Corrected example ​

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() }

Common causes ​

  • Null input or an unsupported object/string type.

Diagnostic fields ​

Example message ​

text
Unsupported preview input type

Released under the MIT License.