DOCXKIT_PLUGIN_LOAD_FAILED: Plugin loading failed
Loading failed because of the platform, security policy, import, module export, or plugin factory.
What to do
- For environment failures, use the appropriate browser or Node.js loader.
- For import failures, check the entry, dependencies, and network.
- For export/factory failures, return a valid plugin instance and inspect the original cause.
- For security failures, review source and permissions against policy; keep untrusted code blocked.
Problem example
ts
// An invalid module export:
export default { name: 'example' }Corrected example
ts
import { definePlugin } from 'docx-kit'
import { Paragraph } from 'docx'
export default definePlugin({
name: 'example',
render: () => new Paragraph('Hello'),
})Common causes
- An unsupported source type, policy rejection, import error, or invalid plugin export.
Diagnostic fields
code:PLUGIN_LOAD_FAILEDdiagnosticCode:DOCXKIT_PLUGIN_LOAD_FAILEDname:DocxKitErrordocs: https://docx-kit.ntnyq.dev/errors/docxkit_plugin_load_failed/
Example message
text
Plugin execution blocked by security policy: example