Skip to content

DOCXKIT_PLUGIN_RENDER_FAILED: Plugin rendering failed ​

The plugin render method threw, or a PDK render assertion rejected its output.

What to do ​

  1. Inspect the original cause locally and validate the plugin options.
  2. Return supported docx elements from render.
  3. For PDK assertions verify the expected element types and counts.

Problem example ​

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

const plugin = definePlugin({
  name: 'example', render() { throw new Error('Resource unavailable') },
})
await createDocx().use(plugin).plugin('example', {}).toBlob()

Corrected example ​

ts
import { createDocx, definePlugin } from 'docx-kit'
import { Paragraph } from 'docx'

const plugin = definePlugin({
  name: 'example', render: () => new Paragraph('Hello'),
})
const blob = await createDocx().use(plugin).plugin('example', {}).toBlob()

Common causes ​

  • A renderer exception, invalid options, or an unexpected PDK output type.

Diagnostic fields ​

Example message ​

text
Plugin render failed: example

Released under the MIT License.