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'. The two contradict each other. Kubb reports the config 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 { 
defineConfig
} from 'kubb/config'
import {
pluginAxios
} from '@kubb/plugin-axios'
export default
defineConfig
({
input
: './petStore.yaml',
output
: {
path
: './src/gen' },
plugins
: [
pluginAxios
({
output
: {
path
: 'clients',
mode
: 'directory' },
group
: {
type
: 'tag' },
}), ], })

Common causes

  • A plugin sets output: { mode: 'file' } but also passes a sibling group option.

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