Skip to content

No output emitted even for correct files in Project References if one file has error #38537

@dandv

Description

@dandv

TypeScript Version: 3.9.2

Search Terms:
project references emit error force noEmitOnError

Code

tsconfig.json

{
  "files": [],
  "references": [
    { "path": "./project1" }
  ]
}

project1/tsconfig.json

{
  "noEmitOnError": false
}

project1/ok.ts

console.log('Hello world');

project1/fail.ts

const foo: string = 42;  // TS error
console.log(foo);

Expected behavior:
When I run tsc --build --force --verbose, I expect at least project1/ok.js to be output, because:

  1. ok.ts compiles correctly
  2. there are no dependencies mentioned in the Caveats section on Project References
  3. I've specified "noEmitOnError": false explicitly in project1/tsconfig.json
  4. I've passed the --force flag

Actual behavior:
Nothing is generated.

Reproduction repo:
https://github.com/dandv/ts-project-ref-bug

Metadata

Metadata

Assignees

Labels

Working as IntendedThe behavior described is the intended behavior; this is not a bug

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions