DOCXKIT_PREVIEW_INPUT_INVALID: Invalid preview input
The preview input is absent or not one of the supported input types.
What to do
- Pass a DOCX Blob, ArrayBuffer, Uint8Array, or URL.
- Wait for generation to finish before starting preview.
Problem example
ts
// Invalid external input:
const input = nullCorrected 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
code:PREVIEW_INPUT_INVALIDdiagnosticCode:DOCXKIT_PREVIEW_INPUT_INVALIDname:DocxKitErrordocs: https://docx-kit.ntnyq.dev/errors/docxkit_preview_input_invalid/
Example message
text
Unsupported preview input type