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

Refresh

2 weeks ago

Views

4 time

0

So if I execute:

tsc

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