'rootDir' is expected to contain all source files
See original GitHub issueI am facing issue with ngx-uploader. when I run tsc, it’s working fine. but when I run npm start it is giving me below error
error TS6059: File ‘node_modules/ngx-uploader/src/classes/index.ts’ is not under ‘rootDir’ ‘xxx/src’. ‘rootDir’ is expected to contain all source files.
tsconfig.json
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"rootDir": "src/",
"outDir": "build",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [ "es2015", "dom" ],
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true
},
"exclude": [
"node_modules",
"**/*.spec.ts",
"bower_components",
"build"
]
}
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
error TS6059: File is not under 'rootDir' .. 'rootDir' is expected ...
One fix is to just remove "rootDir": "src" from compiler options, so it gets set automatically. Caution: rootDir will then consider both ...
Read more >File is not under 'rootDir' 'packages'. 'rootDir' is expected to ...
File is not under 'rootDir' 'packages'. 'rootDir' is expected to contain all source files in npm preset #10773.
Read more >File is not under 'rootDir' error in TypeScript | bobbyhadz
The "File is not under 'rootDir'" error occurs when we try to import something from a file that is not located under the...
Read more >TSConfig Option: rootDir - TypeScript
rootDir. Default: The longest common path of all non-declaration input files. ... the default is instead the directory containing the tsconfig.json file.
Read more >Diagnostics option | ts-jest - GitHub Pages
6059 : 'rootDir' is expected to contain all source files. 18002 : The 'files' list in config file is empty. (it is strongly...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
should exclude all source files
in tsconfig.json,example:here
/testscontain ts source files. see: https://github.com/Microsoft/TypeScript/issues/9858There’s no code in there using
ts-node. The error is fromtsc. The problem is your dependency - your depending on a TypeScript file outside ofsrc/and need to fix that.