# TS5055: Cannot write file '…' because it would overwrite input file.

> Compiling would write an output file over one of the input files, typically a .js input with allowJs. Set outDir, or exclude the file.

## What it means

With `allowJs`, JavaScript files are inputs, and emitting next to them would replace them with
their own output. The config is rejected instead. `ts_r_config` detects this, but ts-r-check doesn't print program-level option checks yet, so
running it on such a config shows no error today.

## How to fix

- Set `outDir` so output goes to a separate directory.
- Or set `noEmit` if you only type-check.
- Or exclude the JavaScript files from the project.

Source: https://ts-r.dev/errors/TS5055/
