Skip to content

DOCXKIT_PLUGIN_LOAD_FAILED: Plugin loading failed ​

Loading failed because of the platform, security policy, import, module export, or plugin factory.

What to do ​

  1. For environment failures, use the appropriate browser or Node.js loader.
  2. For import failures, check the entry, dependencies, and network.
  3. For export/factory failures, return a valid plugin instance and inspect the original cause.
  4. 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 ​

Example message ​

text
Plugin execution blocked by security policy: example

Released under the MIT License.