Skip to content

tsc v3.4RC: Incremental build fails when --rootDir passed on CLI #30457

Closed
@Coridyn

Description

@Coridyn

TypeScript Version: 3.4.0-dev.20190316

Search Terms: incremental, False expression, both be relative

Code

//tsconfig.json
{
    "compilerOptions": {
        "incremental": true,
        "outDir": "dist"
    }
}

$ tsc -p tsconfig.json --rootDir src

Expected behavior:
Project is built successfully.

Actual behavior:
Build fails with Error: Debug Failure. False expression: Paths must either both be absolute or both be relative.

When a project has this setup:

  • "incremental": true
  • outDir has value (doesn't matter if the value is from tsconfig.json or CLI)
  • --rootDir ... set from CLI

NOTE: Build is successful when rootDir value is set in tsconfig.json (instead of passed on CLI).

So this will work:

//tsconfig.json
{
    "compilerOptions": {
        "incremental": true,
        "outDir": "dist",
        "rootDir": "src"
    }
}

$ tsc -p tsconfig.json

Reproduction Link:
Project available here: https://github.com/Coridyn/ts34-incremental-issue

Related Issues: N/A

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions