This bug is occurring in a monorepo project managed with Yarn Workspaces. I've recently upgraded it to TypeScript 3 and was looking to take advantage of Project References. To do this, I set composite: true under compilerOptions in tsconfig.json for each subpackage. If I set it to false, then everything works fine.
$ typedoc --out docs --target es6 --theme minimal --mode file src
Using TypeScript 3.0.1 from /[PROJECT_ROOT]/node_modules/typescript/lib
/[PROJECT_ROOT]/node_modules/typescript/lib/typescript.js:14080
return path.replace(backslashRegExp, ts.directorySeparator);
^
TypeError: Cannot read property 'replace' of undefined
at Object.normalizeSlashes (/[PROJECT_ROOT]/node_modules/typescript/lib/typescript.js:14080:21)
at getCommonSourceDirectory (/[PROJECT_ROOT]/node_modules/typescript/lib/typescript.js:82737:68)
at verifyCompilerOptions (/[PROJECT_ROOT]/node_modules/typescript/lib/typescript.js:84278:27)
at Object.createProgram (/[PROJECT_ROOT]/node_modules/typescript/lib/typescript.js:82703:9)
at Converter.convert (/[PROJECT_ROOT]/node_modules/typedoc/dist/lib/converter/converter.js:109:26)
at CliApplication.Application.convert (/[PROJECT_ROOT]/node_modules/typedoc/dist/lib/application.js:84:37)
at CliApplication.bootstrap (/[PROJECT_ROOT]/node_modules/typedoc/dist/lib/cli.js:62:32)
at CliApplication.Application [as constructor] (/[PROJECT_ROOT]/node_modules/typedoc/dist/lib/application.js:44:15)
at new CliApplication (/[PROJECT_ROOT]/node_modules/typedoc/dist/lib/cli.js:38:42)
at Object.<anonymous> (/[PROJECT_ROOT]/node_modules/typedoc/bin/typedoc:4:1)
It should generate docs with no problems.
Thanks for the report!
I use typedoc programmatically and got same issue.
TypeScript crashes with following error(s):
File '/path/to/file.ts' is not listed within the file list of project ''. Projects must list all files or use an 'include' pattern.
My project and global TS configs are:
Project config
```{
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"rootDir": "src",
"outDir": "build",
"strictPropertyInitialization": false,
"noUnusedParameters": false,
"allowUnusedLabels": true,
"noUnusedLocals": false
},
"include": [
"src"
],
"references": [
{
"path": "../reference"
}
]
}
**Global config**
```{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"lib": ["esnext"],
"declaration": true,
"importHelpers": true,
"noEmitHelpers": true,
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictBindCallApply": true,
"strictPropertyInitialization": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noUnusedLocals": true,
"noFallthroughCasesInSwitch": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"newLine": "LF",
"allowJs": false,
"moduleResolution": "node",
"skipLibCheck": true,
"experimentalDecorators": true,
"types": [],
"composite": true,
"incremental": true,
"baseUrl": ".",
"paths": {
"@app/*": [
"packages/*/src"
]
}
},
"include": [],
"exclude": ["node_modules"]
}
I suspect this is at least related to #380, TypeDoc doesn't seem to support the extends option in tsconfig.json. I think fixing that should at least improve this.
Typedoc doesn't support Solution style: "https://angular.io/config/solution-tsconfig".
Can't use with Angular 10.
Most helpful comment
I suspect this is at least related to #380, TypeDoc doesn't seem to support the
extendsoption intsconfig.json. I think fixing that should at least improve this.