Skip to content

KUBB_INVALID_PLUGIN_OPTIONS: Invalid plugin options

Code: KUBB_INVALID_PLUGIN_OPTIONS Level: error

A plugin was given options that cannot be honored together. The main case is output.mode: 'file' (the default) paired with a group option. A single-file output has nothing to split into groups, so the build stops instead of producing a layout the options do not describe.

What happened

output.mode: 'file' writes everything into one file at output.path. The group option splits output into per-tag or per-path subdirectories, which only applies to output.mode: 'directory'. Kubb reports the contradiction as invalid at plugin setup rather than guessing a layout. The TypeScript types catch the same mistake at compile time, but a config written in JavaScript or cast to any only surfaces it here. Since output.mode defaults to 'file', adding group without also setting mode: 'directory' triggers this diagnostic.

How to fix it

  • Remove the group option when you want a single file.
  • Or add output.mode: 'directory' (one file per operation or schema) and keep group to organize that output into subdirectories.
kubb.config.ts
typescript
import {  } from 'kubb/config'
import {  } from '@kubb/plugin-axios'

export default ({
  : './petStore.yaml',
  : { : './src/gen' },
  : [
    ({
      : { : 'clients', : 'directory' },
      : { : 'tag' },
    }),
  ],
})

Common causes

  • A plugin sets output: { mode: 'file' } but also passes a sibling group option.
  • Two plugins list each other in dependencies, so the graph has a cycle and the plugins cannot be ordered. The message names the cycle: Plugin dependencies form a cycle: plugin-a → plugin-b → plugin-a. Remove one of the dependencies entries to break it.

Example output

Terminal
text
[KUBB_INVALID_PLUGIN_OPTIONS] plugin-axios: Plugin "plugin-axios" sets `output.mode: 'file'` but also configures a `group` option.
  fix: A single-file output has nothing to group. Remove the `group` option, or use `output.mode: 'directory'` to organize files into subdirectories.
  see: https://kubb.dev/docs/5.x/reference/diagnostics/kubb-invalid-plugin-options

See also