KUBB_FORMAT_FAILED: Format failed#
Code: KUBB_FORMAT_FAILED
Level: error
The formatter pass over the generated files failed. Formatting runs after generation. The files are written, but the run is marked failed.
What happened#
When output.format is set, Kubb runs the configured formatter (oxfmt, biome, or prettier) over the output directory. A non-zero exit from the formatter shows up here, in the summary, and in --reporter json. Earlier versions swallowed it, so a broken formatter config went unnoticed.
How to fix it#
- Confirm the formatter is installed and its config is valid.
- Run it manually on the output to see the underlying error, for example
biome check --write ./src/gen. - Remove or change
output.formatif you do not want a formatter pass.
Common causes#
- The formatter is not installed in the project.
- The formatter config is invalid or points at a missing file.
- The formatter rejects the generated code.
Example output#
[KUBB_FORMAT_FAILED]: formatter failed: Cannot find module 'oxfmt'
fix: Check that the tool is installed and that the command and its config are correct.
see: https://kubb.dev/docs/5.x/reference/diagnostics/kubb-format-failed