Are you an LLM? You can read better optimized documentation at /docs/5.x/reference/diagnostics/kubb-invalid-plugin-options.md for this page in Markdown format
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' 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.
How to fix it
- Remove the
groupoption when you want a single file. - Or switch to
output.mode: 'directory'(the default, one file per operation or schema) and keepgroupto organize that output into subdirectories.
kubb.config.ts
typescript
import { } from 'kubb'
import { } from '@kubb/plugin-client'
export default ({
: { : './petStore.yaml' },
: { : './src/gen' },
: [
({
: { : 'clients', : 'directory' },
: { : 'tag' },
}),
],
})Common causes
- A plugin sets
output: { mode: 'file' }but also passes a siblinggroupoption.
Example output
Terminal
text
[KUBB_INVALID_PLUGIN_OPTIONS] plugin-client: Plugin "plugin-client" 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