Skip to content

DOCXKIT_UNKNOWN_NODE_TYPE: Unknown node type ​

No compiler supports this node in its current context.

What to do ​

  1. Use a documented DSL type.
  2. Represent custom content with a registered plugin node.
  3. Keep sectionBreak nodes at document level, outside nested content.

Problem example ​

ts
// Invalid DSL fragment:
const node = { type: 'paragaph', text: 'Hello' }

Corrected example ​

ts
import { renderDocx } from 'docx-kit'

const doc = await renderDocx({
  content: [{ type: 'paragraph', text: 'Hello' }],
})
const blob = await doc.toBlob()

Common causes ​

  • Misspelled node types, block nodes used inline, or nested section breaks.

Diagnostic fields ​

Example message ​

text
Unknown node type: unknown

Released under the MIT License.