Closed
Description
TypeScript Version: 2.6.0-rc
Code
With a directory layout like:
node_modules/
src/tsconfig.json
src/index.ts
package.json
import findCacheDir = require('find-cache-dir')
Expected behavior:
Compilation with no errors (other than findCacheDir not used if the option is enabled)
Actual behavior:
Intermittent error TS6059 whenever the file is edited. The error occasionally goes away or returns whenever a build is triggered by --watch
.
If there are multiple files in the project almost all of them will produce errors for the things they are importing from node modules. But only sometimes 😕
error TS6059: File '.../node_modules/find-cache-dir/index.js' is not under 'rootDir' '.../src'. 'rootDir' is expected to contain all source files.