different-ai/openwork · warning

extensions.add_plugin_component_required

extensions.add_plugin_component_required

Error message

extensions.add_plugin_component_required

What it means

A plugin-kind library item must ship at least one component draft (name and content both non-empty). createLibraryItem counts such drafts from input.components and throws the localized t('extensions.add_plugin_component_required') when none qualify.

Source

Thrown at apps/app/src/react-app/domains/settings/state/extensions-store.ts:2261

    const instructions = input.instructions.trim();
    const drafts = input.components?.filter((component) => component.name.trim() && component.content.trim()) ?? [];
    if (!input.name.trim()) {
      throw new Error(t("extensions.add_name_required"));
    }
    if (kind === "mcp") {
      if (!instructions) {
        throw new Error(t("extensions.add_mcp_url_required"));
      }
    } else if (kind !== "plugin") {
      if (!description) {
        throw new Error(t("extensions.add_description_required"));
      }
      if (!instructions) {
        throw new Error(t("extensions.add_instructions_required"));
      }
    }
    if (kind === "plugin" && drafts.length === 0) {
      throw new Error(t("extensions.add_plugin_component_required"));
    }

    const settings = readDenSettings();
    const token = settings.authToken?.trim() ?? "";
    const orgId = settings.activeOrgId?.trim() ?? "";
    if (!token || !orgId) {
      throw new Error(t("extensions.add_sign_in_required"));
    }
    const client = createDenClient({
      baseUrl: settings.baseUrl,
      token,
    });
    const body = denLibraryPluginCreateRequest(kind, {
      ...input,
      components: kind === "plugin" ? drafts : input.components,
    });
    try {
      await client.setActiveOrganization({ organizationId: orgId });

View on GitHub (pinned to 2b7df46e8a)

Solutions

  1. Add at least one component with both name and content non-empty before calling.
  2. Validate component drafts in the form: count entries where name.trim() && content.trim() and disable submit when zero.
  3. If components are optional for your use case, use a kind other than 'plugin'.

Example fix

// before
await createLibraryItem('plugin', { name: 'p', components: [{ name: '', content: 'x' }] });
// after
const drafts = form.components.filter(c => c.name.trim() && c.content.trim());
if (drafts.length === 0) { showError(t('extensions.add_plugin_component_required')); return; }
await createLibraryItem('plugin', { ...form, components: drafts });
Defensive patterns

Strategy: validation

Validate before calling

const drafts = (input.components ?? []).filter(c => c.name.trim() && c.content.trim());
if (kind === 'plugin' && drafts.length === 0) {
  showError(t('extensions.add_plugin_component_required')); return;
}

Try / catch

try {
  await createLibraryItem('plugin', input);
} catch (e) {
  if (e instanceof Error && e.message === t('extensions.add_plugin_component_required')) {
    showError(e.message);
  } else throw e;
}

Prevention

When it happens

Trigger: Calling createLibraryItem('plugin', input) where input.components is undefined, an empty array, or every entry has an empty/whitespace name or content.

Common situations: User opens the plugin tab and submits without adding any file/component draft; drafts were entered but one field (name or content) left blank so all were filtered out; automation passes components: [] assuming server-side defaults.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01). Data as JSON: /api/errors/984c1ae65d44cb40. Report an issue: GitHub.