TS6059: File is not under rootDir - in CI
A compiled file lives outside the configured rootDir, so tsc cannot compute a consistent output structure.
What this error means
Type-checking/build fails with TS6059 naming a file outside rootDir, often an imported file from a sibling package.
tsc
error TS6059: File '/app/shared/types.ts' is not under 'rootDir' '/app/src'. 'rootDir' is expected to contain all source files.Common causes
How to fix it
Widen rootDir or restructure includes
- Set rootDir to a directory containing all compiled sources, or remove it to let TS infer
tsconfig.json
{
"compilerOptions": { "rootDir": "." }
}Use project references for shared code
- Build shared packages separately and reference them rather than importing source across roots
How to prevent it
- Keep rootDir broad enough for all sources, or use project references for cross-package imports.
Related guides
TS18003: No inputs were found in config file - in CIFix "error TS18003: No inputs were found in config file 'x'" when tsc runs in CI - include/files/exclude matc…
TS6053: File not found - in CIFix "error TS6053: File 'x' not found" when tsc runs in CI - a files entry or a referenced path that does not…