typscript compiler (tsc) throws error, but only when used in yarn script, otherwise works fine


February 2019


4 time


So if I execute:


Everything compiles, no issues. Picks up patterns in tsconfig.json

# inside package.json
scripts: { 
  "build" : "tsc" 

$ yarn build

Throws error.

error TS6307: File '***' is not in project file list. Projects must list all files or use an 'include' pattern.

error Command failed with exit code 2.

The files are in the pattern, as running tsc without yarn yeilds desired effect.

Why would this happen?

0 answers