DOCXKIT_PLUGIN_RENDER_FAILED: Plugin rendering failed
The plugin render method threw, or a PDK render assertion rejected its output.
What to do
- Inspect the original cause locally and validate the plugin options.
- Return supported docx elements from render.
- 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
code:PLUGIN_RENDER_FAILEDdiagnosticCode:DOCXKIT_PLUGIN_RENDER_FAILEDname:DocxKitErrordocs: https://docx-kit.ntnyq.dev/errors/docxkit_plugin_render_failed/
Example message
text
Plugin render failed: example